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
<?= disabled
Moderator: General Moderators
Re: <?= disabled
There are 10 types of people in this world, those who understand binary and those who don't
Re: <?= disabled
Don't enable it. Fix the code.
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: <?= disabled
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
They are handy in templates, short tags that is, but I beliebe longer versions are required for XML compliance.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.
Run a PHP script with short tags through a XML parser and see what happens.
Cheers,
Alex
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: <?= disabled
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?