Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13774 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47850 invoked by uid 1010); 7 Nov 2004 23:26:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47803 invoked from network); 7 Nov 2004 23:26:37 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 7 Nov 2004 23:26:37 -0000 Received: (qmail 22564 invoked from network); 7 Nov 2004 23:26:35 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 7 Nov 2004 23:26:36 -0000 Message-ID: <5.1.0.14.2.20041107152338.03dfc060@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 07 Nov 2004 15:26:29 -0800 To: Timm Friebe ,internals@lists.php.net In-Reply-To: <1099844772.320.6.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] __call interceptor and static methods From: andi@zend.com (Andi Gutmans) References: <1099844772.320.6.camel@localhost> In most cases method overloading is used for objects and not for classes (for example, initiating a SOAP object and then calling methods on it.). It doesn't make sense to mix these two things because it would lead to confusion what context the method was called in. You would either need another call back or pass a flag to __call() and in my opinion just doesn't seem to be worth it. Andi At 05:26 PM 11/7/2004 +0100, Timm Friebe 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 > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php