Hi,
My name is Rick.. I done some light work on documentation side of things,
but I had a question because I've been working a lot with the Symfony
framework lately. Some in the Symfony irc room seem to be under the
impression that short_open_tags is to be deprecated in php6. Is there any
weight to this? I personally have found short tags a great tool, and
simplifies a lot of things. In cases where there is the alternative syntax
being used (great when working with php templates), <? If( $you == $them):
?>. I understand the biggest reason to discourage short tags is for xml.
Besides, how many documents are really written in xml? And how many
actually use raw xml? Can we not still put <?xml inside of quoted echoes?
Also, whats wrong with xml developers if they so desire to explicity place
php_value in their .htaccess or even explicitly using an ini_set()
?
Ensuring its set in their htaccess would be the best if they were so scared
about getting placed on a server that supported short tags. For example,
Debian repeatedly enables short tags by default when the php-core gives it
the opposite behavior. And why not? Short tags are a great shortcut, and I
don't think I could ever see how it could ever be perceived as that bad of a
coding style.
Do short tags promote laziness? Maybe, but does not php itself promote
laziness? PHP allows one to easily blend a programming language in with
html code rather than have to systematically write an entire file in one
programming language like many other languages. We even have output buffers
for those that are even lazier beyond that they want to run through their
output code after its already been sent to the end user. So, in that case I
don't think it promotes laziness anymore than what php at its core is meant
to be provide. A very elegant programming language that can be punched out
quickly and efficiently blended with the hypertext markup language.
Do a lot of servers really disable them by default? I honestly don't see
that many, I know a select few that disable them, however the majority of
the servers I work on DO SUPPORT short tags. :)
Alright, now to wrap my little rant up and repeat the original purpose this
email. Is there any weight to short tags being deprecated in future php
versions? I see no official mention of this anywhere.
-- Rick
Rick Bird wrote:
My name is Rick.. I done some light work on documentation side of things,
but I had a question because I've been working a lot with the Symfony
framework lately. Some in the Symfony irc room seem to be under the
impression that short_open_tags is to be deprecated in php6. Is there any
weight to this? I personally have found short tags a great tool, and
simplifies a lot of things. In cases where there is the alternative syntax
being used (great when working with php templates), <? If( $you == $them):
?>. I understand the biggest reason to discourage short tags is for xml.
Now that <?= has been properly separated from <? some of the 'pressure' has been
removed. Any attempt to remove <?= WOULD be strongly opposed, but I am in total
agreement with you on <? for exactly the same reason. Simple templating systems
don't need anything more and adding <?php everywhere does make these a lot more
difficult to read. To my mind this is what PHP is all about, and killing things
just because they don't conform with the 'perfect programming language' is
irritating. Perhaps another example where two versions of PHP might actually be
a sensible split?
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
I also think <? is good. Consider:
<? if (user.loggedin) ?>
<a href=/logout>Logout</a>
<? elseif ?>
<? href=/login>Log in</a> | <a href=/register>Register</a>
<? endif ?>
With <?php, it's less readable (it's not so bad, but I certainly prefer the
former.)
<?php if (user.loggedin) ?>
<a href=/logout>Logout</a>
<?php elseif ?>
<a href=/login>Log in</a> | <a href=/register>Register</a>
<?php endif ?>
Rick Bird wrote:
My name is Rick.. I done some light work on documentation side of
things,
but I had a question because I've been working a lot with the Symfony
framework lately. Some in the Symfony irc room seem to be under the
impression that short_open_tags is to be deprecated in php6. Is there any
weight to this? I personally have found short tags a great tool, and
simplifies a lot of things. In cases where there is the alternative
syntax
being used (great when working with php templates), <? If( $you == $them):
?>. I understand the biggest reason to discourage short tags is for xml.Now that <?= has been properly separated from <? some of the 'pressure'
has been removed. Any attempt to remove <?= WOULD be strongly opposed, but
I am in total agreement with you on <? for exactly the same reason. Simple
templating systems don't need anything more and adding <?php everywhere
does make these a lot more difficult to read. To my mind this is what PHP
is all about, and killing things just because they don't conform with the
'perfect programming language' is irritating. Perhaps another example where
two versions of PHP might actually be a sensible split?--
Lester Caine - G8HFLContact - http://lsces.co.uk/wiki/?page=**contacthttp://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.**uk<http://rainbowdigitalmedia.co.uk
Hi,
My name is Rick.. I done some light work on documentation side of things,
but I had a question because I've been working a lot with the Symfony
framework lately. Some in the Symfony irc room seem to be under the
impression that short_open_tags is to be deprecated in php6. Is there any
weight to this?
No, we have no plans to deprecate short tags.
-Rasmus