On Di, 2019-03-12 at 23:50 +0100, Peter Kokot wrote:
> 
> > Which would be good - as all those things make writing portable
> > code
> > harder.
> > 
> >    $ echo '<?xml ?>' | php
> > 
> > Is a valid program, which will behave vastly different based on the
> > ini
> > setting.
> 
> In reality if developer wants to write "portable" and proper PHP
> code, no one actually should use these short tags anymore. If they
> are still used somewhere as part of some legacy code, they won't work
> on majority of PHP installations anymore because the mostly have
> these turned off today in the php.ini files. So, the question here is
> more why supporting a feature that no one should use anymore...

the point is: The program I have shown is valid in both modes. One
version is obviously stupid (referring to the constant 'xml' and not
doing anything further) but still valid.

Being just a developer from down the street I might not have been aware
of that and delivered the program to a user who, for whatever reason,
had short tags enabled and probably won't see a proper error. If they
know there are workarounds ( <?='<?xml ?>'?>  is a portable version)
but such things are a real pain.

Having langage changing based on an ini setting is bad. (ze1
compatibility mode was really really fun in early PHP 5 ... not)

johannes

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to