From:             anthony dot parsons at manx dot net
Operating system: Linux 2.6.23 (Gentoo)
PHP version:      5.2.5
PHP Bug Type:     PDO related
Bug description:  Extending PDO class with a __call() function doesn't work

Description:
------------
With a user-defined class that extends PDO, a __call() method does 
nothing at all. The class behaves as if it didn't exist.

I've tested it on a few other internal classes (the xml-related 
ones) where it works fine, and also with all but the PDO extension 
disabled with the same result.


Reproduce code:
---------------
<?php
class test extends PDO {
    function __call($name, array $args) {
        echo "Called $name in ".__CLASS__.'<br>';
    }
    function foo() {
        echo "Called foo in ".__CLASS__.'<br>';
    }
}
$a = new test('sqlite::memory:');
$a->foo();
$a->bar();
?>

Expected result:
----------------
"Called foo in test
Called bar in test"

Actual result:
--------------
"Called foo in test

 Fatal error: Call to undefined method test::bar() in call.php on 
line 24"

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

Reply via email to