On Wed, May 11, 2011 at 11:55 AM, Daevid Vincent <dae...@daevid.com> wrote:
> <?= $foo ?> is generally NOT what the short tags controversy are about.
> It's the use of <? Some php here ?> vs. <?php some php here ?>
This is the same thing my colleague told me when I first joined and began
learning PHP and is the reason we use <?= and <?php.
While it is true that the 'short_open_tag' directive enables both (for some
> stupid reason), the issue is that it's poor form to use JUST <? And not
> <?php just as it's a bad idea to use <% %> (asp tags).
This is what doesn't make sense to me. One camp says that short open tags
are bad because the option is not always enabled, but that would include <?=
as well. And if <? is only a problem when mixing PHP and XML--and you can
always echo the XML directive anyway--I don't see that <? is actually a
problem once you decide that <?= is okay (short_open_tags is enabled). The
file extension is ".php" so it should be safe to assume that <? means PHP
code follows just as <?= means a PHP expression follows.
There must be some other reason why <? is bad while <?= is okay. If not, no
big deal, and I'll probably keep using <?php anyway, but it seems odd that
there would be so much controversy over it.
This topic was very heated when the core PHP developers were going to remove
> the <? Form all together in future PHP 6 versions and everyone got their
> panties in a bunch because they assumed it meant the <?= form too (which it
> did not).
Out of curiosity, did the original proposal for PHP 6 remove the
short_open_tags setting (and thus <?= as well) or did it redefine <?= not to
be a short open tag?