From: dreadlabs at gmail dot com Operating system: Ubuntu PHP version: 5.2.8 PHP Bug Type: Unknown/Other Function Bug description: Magic method __call() does not work when class is named __call
Description: ------------ I created a class named __call, within that class i created the magic method __call. I then instantiated the __call class and tried to call a non-existent method. I then got a missing argument error from PHP, instead of it using the __call method. Reproduce code: --------------- <?php class __call { public function __call($method, $args){ echo $method."\n"; } } $obj = new __call; $obj->test(); ?> Expected result: ---------------- test Actual result: -------------- Warning: Missing argument 1 for __call::__call(), called in /home/tam/test.php on line 15 and defined in /home/tam/test.php on line 5 Warning: Missing argument 2 for __call::__call(), called in /home/tam/test.php on line 15 and defined in /home/tam/test.php on line 5 -- Edit bug report at http://bugs.php.net/?id=47100&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47100&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47100&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47100&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47100&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47100&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47100&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47100&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47100&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47100&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47100&r=support Expected behavior: http://bugs.php.net/fix.php?id=47100&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47100&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47100&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47100&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47100&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47100&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47100&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47100&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47100&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47100&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47100&r=mysqlcfg