Page 1 of 1

<?= disabled

Posted: Tue Dec 30, 2008 7:05 am
by Nunners
I've just installed a new development server and for some reason <?=some variable?> isn't working?

I'm not sure what it's called, but have gone through the php.ini file, and can't work out how to enable it?

Any hints?

Many thanks
Nunners

Re: <?= disabled

Posted: Tue Dec 30, 2008 7:08 am
by VladSun

Re: <?= disabled

Posted: Tue Dec 30, 2008 7:23 am
by onion2k
Don't enable it. Fix the code.

Re: <?= disabled

Posted: Tue Dec 30, 2008 10:14 am
by volomike
I for one stand up and support short open tags. If they're off, I turn them back on again with ini_set(). It's ridiculous to live without them. Why the longer approach was even considered is beyond my imagination.

Re: <?= disabled

Posted: Tue Dec 30, 2008 10:26 am
by alex.barylski
I for one stand up and support short open tags. If they're off, I turn them back on again with ini_set(). It's ridiculous to live without them. Why the longer approach was even considered is beyond my imagination.
They are handy in templates, short tags that is, but I beliebe longer versions are required for XML compliance.

Run a PHP script with short tags through a XML parser and see what happens.

Cheers,
Alex

Re: <?= disabled

Posted: Tue Dec 30, 2008 10:27 am
by volomike
And here's another oddity about this. So if I were on the core PHP team maintaining PHP, and I discover that <? may come in conflict with an XML designation, then why wouldn't I just make an exception in the code and let that one slip through? Next, I noticed in the php.ini file they have a comment not to enable short tags for redistributable code, but I tell you -- there's a lot of code in distribution that depends on short tags. Next, everyone and their sister knows how to get around the XML problem with an echo statement. And last, I noticed that there's no such comment in the php.ini file regarding the ASP-style tags. So, if the ASP-style tags are okay, then why doesn't the PHP team just make a push for everyone to switch to those?