Re: __invokeStatic() method
| From: | Bruno CHALOPIN | Date: | Tue, 19 Mar 2013 07:54:19 +0000 |
| Subject: | Re: __invokeStatic() method | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-66695@lists.php.net to get a copy of this message | ||
Le Tue, 19 Mar 2013 09:37:43 +0200, Pierre du Plessis a écrit :
> It would break existing software if you have a class and function with
> the same name.
> Consider the following example:
>
> class foo {
> }
>
> function foo()
> {
>
> }
>
> Now what if you have several calls to foo() in your existing
> application? With the new change, will those calls call the function, or
> invoke the __invokeStatic method if it is available?
It will clearly technically lead to a problem. Now I don't see why in the
world a class and a function could share the same name. Regarding
conventions, a class name should begin with an uppercase character and a
function a lowercase one. I don't see any relevant use case where a class
and a function should share the same name.
Bruno