Re: short_open_tag

From: Date: Fri, 21 Mar 2008 22:06:22 +0000
Subject: Re: short_open_tag
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-36303@lists.php.net to get a copy of this message
On 21/03/2008, Elizabeth M Smith <auroraeosrose@gmail.com> wrote: > Wow, noisy... And having made the commit to the dox before the revert, I'm still reeling/reading to try and see which way I would go... > I'd argue that a <?php= shortcut or something similar would help "split > the difference" between the ugliness of the long version and the need to > not break php every time an xml declaration pops up in a file. Even > gettext has a nice _() function shortcut which is less typing than echo > $blah; in every php tag set, and then you wouldn't be fighting with the > potential breakage. The argument that if some new syntax only goes into > 5.3, people can't use it doesn't really hold water here because you > wouldn't be able to rely on flipping the short_tags switch before 5.3 > either. > > I can see both sides of the story, and really don't have a preference - > I'm curious as to the opinions of someone OTHER than Marcus, Stas, > Pierre and Jani ;) If you saw ... <?php $varname; ?> or <?php $varname ?> what would you assume this meant? From this, I would say it isn't a function call as I would need to add () to it. It is not an assignment or declaration. If it was documented that a PHP statement consisting of just a variable name would echo a string, then I think this would solve all the problems of readability. What would you assume a non programmer thought of it? If they were told "this is how you put a PHP variable into a template" would they just go with it? Ok, again, I'm no internals expert. Maybe the _$varname; would be more pleasing. On the plus side there is only 1 PHP tag. No matter what happens <?php will always be the PHP way. I see no need for <?= (and WTF the ASP ones? I'm late to the PHP - only 5 years - but ...!) -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"

« previous php.internals (#36303) next »