#43973 [Opn->Csd]: __autoload called with wrong classname when triggered by static callback

From: Date: Wed, 30 Jan 2008 12:31:03 +0000
Subject: #43973 [Opn->Csd]: __autoload called with wrong classname when triggered by static callback
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121776@lists.php.net to get a copy of this message
ID: 43973 Updated by: tony2001@php.net Reported By: robin_fernandes at uk dot ibm dot com -Status: Open +Status: Closed Bug Type: Class/Object related PHP Version: 6CVS-2008-01-29 (snap) New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2008-01-30 12:26:36] felipe@php.net Simple fix: http://ecl.zoone.com.br/etc/patches/bug43973.diff ------------------------------------------------------------------------ [2008-01-29 18:28:39] robin_fernandes at uk dot ibm dot com Description: ------------ NB: This issue is specific to PHP6 snaps. PHP5.2 and PHP5.3 snaps produce the expected output. When using a callback of the form 'C::f' where class C is not yet defined, __autoload() is invoked with the fully qualified method name as an argument, rather than just the class name. Reproduce code: --------------- <?php function __autoload($name) { echo "Autoload class: $name\n"; if ($name == 'C') { class C { static function f() { echo "In C::f()\n"; } } } } call_user_func('C::f'); ?> Expected result: ---------------- Autoload class: C In C::f() Actual result: -------------- Autoload class: C::f Warning: call_user_func() expects parameter 1 to be valid callback, string given in %s on line 9 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43973&edit=1

« previous php.bugs (#121776) next »