NYCPHP Meetup

NYPHP.org

[nycphp-talk] Short Tags deprecated?

Eddie Drapkin oorza2k5 at gmail.com
Fri Aug 28 15:33:47 EDT 2009


On Fri, Aug 28, 2009 at 2:39 PM, Chuck Reeves<chuck.reeves at gmail.com> wrote:
> /agree which was why I thought this was deprecated.  I guess since the
> webserver knows what parser to pull based off the file extension, it looks
> as if Zend has decided that there would be no benefit to deprecating this
> directive.
>

If you're using file extensions to parse, which I think most people
are, then that still does not solve this problem:

<?xml version "1.0" encoding="utf-8"?>
<something>
<?php echo build_something(); ?>
</something>

Works fine, and as expected, on servers without short_open_tags turned
on.  With them turned on, you have to <?php echo "<?xml..." in order
to get your expected behavior.


On Fri, Aug 28, 2009 at 2:45 PM, Chris Snyder<chsnyder at gmail.com> wrote:
> Which makes it seem like the obvious fix is to parse <? and <?php but
> not parse <?xml. But what do I know?

There's problems with the way scripts are parsed for that, afaik.
There's some reason why <?xml is parsed and not ignored, but I'm not
entirely sure what it is.

>
> Back when I still thought it was fun to write XHTML, I used to do this
> in my templates:
> <?='<?xml version="1.0" encoding="utf-8"?>'?>
>
> Nice, huh?
>

It's snippets like these, imho, that justify the deprecation/removal
of short open tags.



More information about the talk mailing list