Re: [RFC] [DISCUSSION] Consistent Function Names
| From: | Benoit Schildknecht | Date: | Tue, 03 Mar 2015 17:34:19 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Consistent Function Names | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84256@lists.php.net to get a copy of this message | ||
Hi,
I think the new functions must have consistent parameters order too. I think it is about the right time, so we'll have a cleaner and more logical language.
ATM, it's a real headache, we constantly have to read the documentation to make sure we give the arguments in the right order.
For instance
- implode() : "implode() can, for historical reasons, accept its parameters in either order. "
- strpos( $haystack, $needle )
- in_array( $needle, $haystack )
Regards.
Le Mon, 02 Mar 2015 22:52:03 +0100, Yasuo Ohgaki <yohgaki@ohgaki.net> a écrit:
Hi all, First of all, I have no intention to remove nor deprecate old function names. Old function names must exist for compatibility and should be able to use forever. We have CODING_STANDARDS[1] for a long time. However, PHP has so many functions that do not confirm this. Many of violating functions can have standard conforming names safely This RFC[2] proposes the CODING_STANDARDS confirmed function names. The list[3] is almost complete, but improvement can be added. For example, get_rusage() could be sys_get_rusage() because there is sys_getloadavg() already. There would not be much opinions for independent modules like BCMath, GD. Please take a look for others and give your comments. Thank you! [1] https://github.com/php/php-src/blob/master/CODING_STANDARDS [2] https://wiki.php.net/rfc/consistent_function_names [3] https://wiki.php.net/rfc/consistent_function_names#list_of_functions_to_be_renamed -- Yasuo Ohgaki yohgaki@ohgaki.net-- Utilisant le logiciel de courrier d'Opera : http://www.opera.com/mail/