<?= disabled

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Nunners
Forum Commoner
Posts: 89
Joined: Tue Jan 28, 2003 7:52 am
Location: Worcester, UK
Contact:

<?= disabled

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: <?= disabled

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: <?= disabled

Post by onion2k »

Don't enable it. Fix the code.
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: <?= disabled

Post 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.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: <?= disabled

Post 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
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: <?= disabled

Post 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?
Post Reply