Re: Throwing an E_DEPRECATED for short_open_tag

From: Date: Wed, 13 Jan 2010 17:13:42 +0000
Subject: Re: Throwing an E_DEPRECATED for short_open_tag
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-46708@lists.php.net to get a copy of this message
Raphael Geissert wrote: > Rasmus Lerdorf wrote: > >> Raphael Geissert wrote: >>> However, we would like to contribute in the quest to make applications >>> stop using short_open_tag. To do so, we have decided to throw an >>> E_DEPRECATED warning when an application makes use of short_open_tag. The >>> current implementation can be found at [1]. >>> >>> How does this sound? >> We have no plans to deprecate the short open tag. So throwing an >> E_DEPRECATED would not be appropriate. >> > > True. An idea I just had was to continue throwing E_DEPRECATED (or a warning > with a most appropriate name, if one is added) iff short tags are used > without explicitly enabling them at runtime. > > I haven't looked at how the short_open_tag runtime switch was implemented so > I don't know if it's possible or not. > > This would for example make the following code throw a warning: > > foo.php > <? > // ... > ?> > > But not this one: > > bar.php > <?php > // ... > include("./foo.php"); > ?> > > Does that sound more reasonable? or do you have another idea? Then we have to have logic to differentiate <? from <?xml, for example. It would make the parser quite a bit more complex if we have to start parsing stuff outside of the active open tags. Not sure it is worth the effort nor the extra overhead. -Rasmus

« previous php.internals (#46708) next »