Re: __call interceptor and static methods
| From: | Marcus Boerger | Date: | Mon, 08 Nov 2004 10:18:33 +0000 |
| Subject: | Re: __call interceptor and static methods | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13782@lists.php.net to get a copy of this message | ||
Hello Timm,
you won't be able to tell from inside __call() whether a static or
non static method was meant. The same holds for __get() and __set().
Also if we start using such code we'd need a class constructor. Thus
this dicussion is leading to the following set of new magics:
__static_get
__static_set
__static_call
__static_construct
regards
marcus
p.s.: something usefull when it comes to aspect oriented programming
Sunday, November 7, 2004, 5:26:12 PM, you wrote:
> Hi,
> is there any reason why __call shouldn't be invoked for static method
> calls?
> Reproduce
> ---------
> php5 -r 'class A { function __call($name, $args) { var_dump($name,
> $args); } } A::foo();'
> Actual result
> -------------
> Fatal error: Call to undefined method A::foo() in Command line code on
> line 1
> Expected result
> ---------------
> string(3) "foo"
> array(0) {
> }
> - Timm
--
Best regards,
Marcus mailto:helly@php.net