Hacker News new | past | comments | ask | show | jobs | submit login

<? is what is used by XML to indicate a processing instruction.

http://www.javacommerce.com/displaypage.jsp?name=pi.sql&...

<?name pidata?>

So when someone uses <?php in their XML document and tries to run it through PHP, will the collective PHP-internals community explode? React? Ignore it?

<%= has been the compatible way forward since 1996 or so, and the community has chosen to ignore it. We've successfully migrated away from HTTP_GET_VARS, register_globals, and other bad habits. But somehow <?php is lorded over others as 'the one true way', as if somehow typing more boilerplate to avoid conflict with 0.02% of the use cases where there's a problem is something to be proud of.




Can we please give up this ``is-valid-XML'' argument already?

Quick counter-example:

  <?php echo 'foo ?>' ?>
Guess what:

- if interpreted as XML, the processing instruction ends at the first ?>

- if interpreted as PHP, the PHP code ends at the sencond ?>

...which makes the argument against short tags -- XML validity -- moot. Can't be fixed without breaking backward compatibility either. Let's drop the argument now; otherwise somebody well-meaning will try to apply it and will end up breaking backward-compatibility (and removing a neat feature) yet keeping XML-compatibility broken anyway. Just like Robert Eisele did.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: