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]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to