|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-06-05 18:53 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 17:00:01 2025 UTC |
Description: ------------ The magic method __call depends on __callstatic to be called in *class scope*. Adding: static public function __callstatic($a, $b) { print "__callstatic:\n"; var_dump($a); } The __call is called. Therefore, why dependency on __callstatic? Reproduce code: --------------- <?php class bar { public function __call($a, $b) { print "__call:\n"; var_dump($this); } public function test() { self::ABC(); bar::ABC(); call_user_func(array('bar', 'abC')); } } $x = new bar; $x->test(); Expected result: ---------------- __call: object(bar)#1 (0) { } __call: object(bar)#1 (0) { } __call: object(bar)#1 (0) { } Actual result: -------------- __call: object(bar)#1 (0) { } __call: object(bar)#1 (0) { } Warning: call_user_func() expects parameter 1 to be a valid callback, class 'bar' does not have a method 'abc' in ...