#45180 [Opn->Asn]: 'class::method' works differently than array('class', 'method')

From: Date: Wed, 04 Jun 2008 19:18:47 +0000
Subject: #45180 [Opn->Asn]: 'class::method' works differently than array('class', 'method')
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125507@lists.php.net to get a copy of this message
ID: 45180 Updated by: felipe@php.net Reported By: felipe@php.net -Status: Open +Status: Assigned Bug Type: Scripting Engine problem PHP Version: 5.3CVS-2008-06-04 (CVS) -Assigned To: +Assigned To: felipe Previous Comments: ------------------------------------------------------------------------ [2008-06-04 18:30:27] felipe@php.net Description: ------------ See the code below. Reproduce code: --------------- <?php class foo { public function test() { call_user_func(array('FOO', 'ABC')); call_user_func(array($this, 'ABC')); call_user_func('FOO::ABC'); } function __call($a, $b) { print "__call:\n"; var_dump($a); } static public function __callStatic($a, $b) { print "__callstatic:\n"; var_dump($a); } } $x = new foo; $x->test(); Expected result: ---------------- __call: string(3) "ABC" __call: string(3) "ABC" __call: string(3) "ABC" Actual result: -------------- __call: string(3) "ABC" __call: string(3) "ABC" Fatal error: Non-static method foo::ABC() cannot be called statically in ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45180&edit=1

« previous php.bugs (#125507) next »