Re: Remove alternative PHP tags
| From: | Andrea Faulds | Date: | Wed, 10 Sep 2014 01:32:41 +0000 |
| Subject: | Re: Remove alternative PHP tags | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77126@lists.php.net to get a copy of this message | ||
On 10 Sep 2014, at 01:21, Andrea Faulds <ajf@ajf.me> wrote:
> Isn’t this a bit of a needless BC break? Not very nice on people with such codebases. It’s
> also worth pointing out that people might be using these to get around the XML <? issue (granted,
> you can disable short tags).
>
> I’d vote for this if you wrote a convertor script to help people migrate. Otherwise I think
> we’re just being unfair on people who used these tags.
>
> Actually, I’d like to see a Python 2to3-esque tool in general for PHP 7. The easier we make
> the migration, the more likely people will do it.
Some further thoughts after discussing with Tyrael (Ferenc) on IRC.
I initially thought that I’m not really against removing them really, but I think we should have a
script to convert them first. Because someone, somewhere, is gonna need it.
But then I’ve thought more about it. I’m usually OK with certain BC breaks, I just don’t like
this specific one. It doesn’t affect me, but, well, I don’t see the point. It doesn’t really
help language consistency or anything, (OK, sure, only two sets of delimeters now, but it’s not a
big deal like some other things are), and you’ll force people to update every file in their
codebase if they’re affected, assuming people who use alternative tags use them everywhere.
There’s also a security issue here. If someone uses PHP 7 with a codebase that has these
alternative tags, your code is now visible to users instead of the output, which might include
configuration details like database passwords or password hash salts. It’s also possible that
people won’t notice this is happening if they only used these alternative tags in a few obscure
places.
I wonder if, really, we might be better off keeping them around and just outputting E_DEPRECATED. If
we do get rid of them in 7, we should have 5.7 deprecate them.
--
Andrea Faulds
http://ajf.me/