From: junk at thinkof dot net Operating system: OSX 10.4.2 PHP version: 5.0.5 PHP Bug Type: Class/Object related Bug description: Overloading __call() does nothing on an extended class
Description: ------------ Overloading the function __call() results in __call() not be executed when a class is extended. Having the __call() overload in the parent, child or both makes no difference. Reproduce code: --------------- <?php class extendable { function blah (){ print 'blah'; } } class extendee extends extendable { function __call ($method, $args){ print $method; } } $test = new extendee (); $test->blah (); ?> <?php class extendable { function __call ($method, $args){ print $method; } function blah (){ print 'blah'; } } class extendee extends extendable { } $test = new extendee (); $test->blah (); ?> <?php class b { function blah (){ print "In method: blah"; } } class a extends b { function __call ($method, $args){ print '__call(): '.$method; } } $test = new a (); $test->blah (); ?> Expected result: ---------------- __call():blah In method: blah Actual result: -------------- In method: blah -- Edit bug report at http://bugs.php.net/?id=34847&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34847&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34847&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34847&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34847&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34847&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34847&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34847&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34847&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34847&r=support Expected behavior: http://bugs.php.net/fix.php?id=34847&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34847&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34847&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34847&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34847&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34847&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34847&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34847&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34847&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34847&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34847&r=mysqlcfg