Re: short_open_tag

From: Date: Wed, 26 Mar 2008 20:21:08 +0000
Subject: Re: short_open_tag
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-36567@lists.php.net to get a copy of this message
On Wed, Mar 26, 2008 at 8:55 PM, Stanislav Malyshev <stas@zend.com> wrote: > Hi! > > > > I don't think I've ever said I don't like short tags. It's not the > > issue > > here. The issue is that allowing to change it during runtime adds more > > WTF to PHP. WTF factors are bad. > > OK, there were people saying short tags are mortal sin, devil's device > to lure pure souls into the hell and what not. Good that you don't :) > Speaking of the WTF, I don't really see any major WTF since: > 1. 99.9% of the code (except for parser XML templates) works with any > tags settings. One that wouldn't work will bail out immediately with > clearly recognized error message, so the problem would be easy to locate > and fix. > 2. For any code messing with this value - and this code should be only > one place in whole application, the template engine - it is very easy to > restore it afterwards, and any programmer smart enough to write in PHP > would know to do that. > 3. There are a bunch of runtime settings that some code can influence > other code with - most prominent being include path - and we had very > little problem with them being INI_ALL. > 4. This change actually does not remove any existing scenarios and adds > one previously impossible - having short tag templates in the context > where enabling short tags for whole application is not desired. You do know that having short tags enabled will result in a parse error in the following situation, right?: foo.php <?xml version="1.0"> <root> <?php foreach($array as $el => $val) { printf('<%s>%s</%2$s>', $el, $val); } ?> </root> I actually think that by now the most common way to do exactly this is: echo '<?xml version="1.0">'; so being PHP_INI_ALL isn't the worst idea ever - but I still think it'll just create more wtf then necessary. -Hannes

« previous php.internals (#36567) next »