Re: Deprecate short_open_tag ini directive?

From: Date: Wed, 13 Mar 2019 00:14:14 +0000
Subject: Re: Deprecate short_open_tag ini directive?
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-104689@lists.php.net to get a copy of this message
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

« previous php.internals (#104689) next »