#47840 [NEW]: __call ignored when extending PDO

[email protected] ("oorza2k5 at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             oorza2k5 at gmail dot com
Operating system: Linux
PHP version:      5.2.9
PHP Bug Type:     PDO related
Bug description:  __call ignored when extending PDO

Description:
------------
Exact same issue (that was supposedly resolved) as #44425, but now with a
MySQL 5.1 database.

__call() doesn't do anything when extending PDO.

This bug is clearly not fixed.

Reproduce code:
---------------
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('mysql:dbname=test;host=localhost','user','pw');
$a->foo();
$a->bar();
?>

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


Actual result:
--------------
Called foo in test<br>
Fatal error: Call to undefined method test::bar() in test4.php on line 12

-- 
Edit bug report at http://bugs.php.net/?id=47840&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=47840&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=47840&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=47840&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=47840&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47840&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=47840&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=47840&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=47840&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=47840&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=47840&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=47840&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=47840&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=47840&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=47840&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47840&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47840&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=47840&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=47840&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=47840&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=47840&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=47840&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.