I've just voted "no" for this, because it introduces a tiny BC break.
Now, I realize this is a tiny BC break, but it is just those that
drive people nuts when upgrading. There is so much non-public code - a
cursor check of Symfony and ZF is not representative.
From Andrea Faulds:
It is a tiny BC break and it’s for PHP NEXT (i.e 6 or 7), not 5.6. Why not? It’s a
tiny change which will bother some people but make everyone
else’s life easier.
Thank you, Derick, for voting against a BC break.
I do appreciate the intention of making things more consistent.
Given that this is a parser change, I wonder if there is hope of mitigating the BC issues by providing an option to generate "new" code from "old" code. Today, I can run "php -l" and php will tell me about syntax problems. If php6 had a "php --convert-from 5.4.30" that would read in a file that worked in 5.4.30 and output a file that does the same thing using php6 syntax, I think that would be a Good Thing. Perhaps it would be better as a tool on the side than as part of the main php executable. I know such a conversion process is effectively impossible for some BC breaks; I don't know about this one. This RFC struck me as a better candidate than usual.
Thanks for your consideration.
- Todd
Given that this is a parser change, I wonder if there is hope of mitigating the BC issues by providing an option to generate "new" code from "old" code. Today, I can run "php -l" and php will tell me about syntax problems. If php6 had a "php --convert-from 5.4.30" that would read in a file that worked in 5.4.30 and output a file that does the same thing using php6 syntax, I think that would be a Good Thing. Perhaps it would be better as a tool on the side than as part of the main php executable. I know such a conversion process is effectively impossible for some BC breaks; I don't know about this one. This RFC struck me as a better candidate than usual.
For PHP 6, we could probably make a 2to3-style tool (2to3 is a utility for converting Python 2 to Python 3 source code) for converting from PHP 5 to PHP 6. Nikic’s PhpParser would be useful for this, and he’s already made a tool to help spot things this RFC would break.
Andrea Faulds
http://ajf.me/