Re: [RFC Proposal] var keyword deprecation/removal

From: Date: Wed, 09 Mar 2016 11:06:39 +0000
Subject: Re: [RFC Proposal] var keyword deprecation/removal
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-91576@lists.php.net to get a copy of this message
Yasuo Ohgaki wrote on 09/03/2016 10:35:
Hi all, Keeping aliases do not harm much. It may stay forever. How about stop discussion, but write code? The only chance this kind of proposal to pass is existence of "conversion program" that replaces aliases in older codes. If there is anyone who would like to volunteer for this, please write generic code that can replace function/method/class/keyword aliases perfectly. i.e. Write program that understands PHP syntax and replaces targets precisely, not "perl pi.bak -e 's/obsolete_name/new_name/g' *.php. This program would be very useful for us to clean various things up.
Somebody already posted this quick solution, using PHP's built-in tokenizer: https://gist.github.com/colinodell/5fb5e5d474674f294a38 I don't know if there are any edge-cases it doesn't cater for, or undesirable side-effects, but it's certainly smarter than just a Perl regex. There are also examples for making code modification in the docs for Nikita's PHP-Parser library: https://github.com/nikic/PHP-Parser/ Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#91576) next »