RE: [PHP] __call and static methods

From: Date: Tue, 28 Sep 2004 18:39:46 +0000
Subject: RE: [PHP] __call and static methods
Groups: php.general 
Request: Send a blank email to php-general+get-198103@lists.php.net to get a copy of this message
[snip] Is there a way to get __call to work for static methods? It doesn't seem to work by default and the docs are pretty sparse. [/snip] Found a little more info http://us4.php.net/manual/en/language.oop5.overloading.php <?php class Caller { private $x = array(1, 2, 3); function __call($m, $a) { print "Method $m called:\n"; var_dump($a); return $this->x; } } $foo = new Caller(); $a = $foo->test(1, "2", 3.4, true); var_dump($a); ?>

« previous php.general (#198103) next »