From:             robin_fernandes at uk dot ibm dot com
Operating system: 
PHP version:      6CVS-2008-01-29 (snap)
PHP Bug Type:     Class/Object related
Bug description:  __autoload called with wrong classname when triggered by 
static callback

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 bug report at http://bugs.php.net/?id=43973&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43973&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43973&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43973&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43973&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43973&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43973&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43973&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43973&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43973&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43973&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43973&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43973&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43973&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43973&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43973&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43973&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43973&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43973&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43973&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43973&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43973&r=mysqlcfg

Reply via email to