Re: Flexible function naming
On Dec 14, 2013 7:45 AM, "Robert Cerny" <[email protected]> wrote:
>
> Hello,
>
> I am new to the list. I have been a PHP user for 8 years. I am a
progammer for 30 years. Initially i wanted to post this as an RFC, but
could not figure out how to register. When accessing [1] i get 'Command
disabled: register'. I did some research, but the archives are vast, so
please accept my apologies in advance if this has already been discussed.
Yes one cannot register.
> When a PHP code base is growing over time it looks more and more
'diverse', because of inconsistent function and method naming in core PHP
and third party libraries. This cannot be changed by any guidelines. The
author of a function has the freedom to assign any name. The user of a
function needs some flexibility in referring to a function. It should be
possible to use 'array_key_exists', 'arrayKeyExists' or
'arraykeyExists'.
Because of the performance impact and possible resolution conflicts this
language feature needs to be disabled by default.
Oh, I think this is not the best example, but in 5.6 you can achieve that
with the new 'use function' feature.
> This is not difficult to implement. It is only necessary to normalize
function names: remove all but leading underscores and lower case the
result. The likelihood of conflict is very small.
>
> This small change would allow coding teams to create a consistent code
base based on 'their' guidelines. Motto: "Have it your way!".
No.
>
> Best regards,
>
> Robert Cerny
>
> [1] https://wiki.php.net/start?do=register
Thread (14 messages)