#43282 [Opn->Bgs]: call_user_func can't call non-static funcs statically

From: Date: Wed, 14 Nov 2007 01:27:45 +0000
Subject: #43282 [Opn->Bgs]: call_user_func can't call non-static funcs statically
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119619@lists.php.net to get a copy of this message
ID: 43282 Updated by: johannes@php.net Reported By: stas at zend dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: * PHP Version: 5.3CVS-2007-11-13 (CVS) Assigned To: jani New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. it's the same issue like #43231 Previous Comments: ------------------------------------------------------------------------ [2007-11-13 23:50:31] stas@php.net I think it was recent change by Jani that broke it. ------------------------------------------------------------------------ [2007-11-13 23:28:27] stas at zend dot com Description: ------------ When call_user_func is given callback array with class name as string, it refuses to call non-static functions, even though PHP can call it with just E_STRICT. Reproduce code: --------------- <?php class Foo { function bar() { echo "OK!"; } } call_user_func(array("Foo", "bar"), 123); Foo::bar(123); Expected result: ---------------- OK!OK! Actual result: -------------- Warning: call_user_func() expects parameter 1 to be valid callback, array given in t.php on line 5 OK! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43282&edit=1

« previous php.bugs (#119619) next »