#46542 [NEW]: Extending PDO class with a __call() function doesn't work as expected

From: Date: Tue, 11 Nov 2008 10:23:16 +0000
Subject: #46542 [NEW]: Extending PDO class with a __call() function doesn't work as expected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-130866@lists.php.net to get a copy of this message
From: myardbenoit at gmail dot com Operating system: GNU/Linux PHP version: 5.2.6 PHP Bug Type: PDO related Bug description: Extending PDO class with a __call() function doesn't work as expected Description: ------------ A user-defined class extending PDO will have troubles with __call(): the method name passed to __call() is always lowercase. As far as I can tell, it only happens when extending PDO. As a side-note, I have seen several issues with __call() and PDO.. is there anything special about PDO which could explain that ? Reproduce code: --------------- class A extends PDO { function __call($m, $p) {print __CLASS__."::$m\n";} } class B extends XSLTProcessor { function __call($m, $p) {print __CLASS__."::$m\n";} } $a = new A('sqlite:dummy.db'); $a->truc(); $a->TRUC(); $b = new B(); $b->truc(); $b->TRUC(); Expected result: ---------------- A::truc A::TRUC <----------- B::truc B::TRUC Actual result: -------------- A::truc A::truc <----------- B::truc B::TRUC -- Edit bug report at http://bugs.php.net/?id=46542&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46542&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46542&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46542&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46542&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46542&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46542&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46542&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46542&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46542&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46542&r=support Expected behavior: http://bugs.php.net/fix.php?id=46542&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46542&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46542&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46542&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46542&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46542&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46542&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46542&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46542&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46542&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46542&r=mysqlcfg

« previous php.bugs (#130866) next »