Re: [PHP] __call and static methods
* Thus wrote Jackson Miller: > So, now you have found the static method docs, and you have found the > very minimal __call() docs but you have not come close to answering > anything about using call with static methods. > > For those who seem to miss the point, a static method call would be like: > $a = Caller::test(1, "2", 3.4, true); > > I have tried defining __call as a static method, but that does not > give the desired result either. __call() is only available with a scope of an instance of an object. You can suggest adding this as a Feature/Request at bugs.php.net, if you desire such a thing. Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] __call and static methods
[snip] So, now you have found the static method docs, and you have found the very minimal __call() docs but you have not come close to answering anything about using call with static methods. [/snip] Sorry, I was just trying to help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] __call and static methods
So, now you have found the static method docs, and you have found the very minimal __call() docs but you have not come close to answering anything about using call with static methods. For those who seem to miss the point, a static method call would be like: $a = Caller::test(1, "2", 3.4, true); I have tried defining __call as a static method, but that does not give the desired result either. -Jackson On Tue, 28 Sep 2004 13:39:46 -0500, Jay Blanchard <[EMAIL PROTECTED]> wrote: > Found a little more info > http://us4.php.net/manual/en/language.oop5.overloading.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); > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] __call and static methods
Hmm don't see clearly how could work for static methods :P On Tue, Sep 28, 2004 at 01:39:46PM -0500, Jay Blanchard wrote: > [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 > > 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); > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Maciek Ruckgaber Bielecki "If my theory of relativity is proven successful, Germany will claim me as a German and France will declare that I am a citizen of the world." --Albert Einstein-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] __call and static methods
[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 x; } } $foo = new Caller(); $a = $foo->test(1, "2", 3.4, true); var_dump($a); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] __call and static methods
[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] http://us4.php.net/manual/en/language.oop5.static.php may help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php