php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47840 __call ignored when extending PDO
Submitted: 2009-03-30 16:45 UTC Modified: 2009-03-30 17:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: oorza2k5 at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: oorza2k5 at gmail dot com
New email:
PHP Version: OS:

 

 [2009-03-30 16:45 UTC] oorza2k5 at gmail dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-30 16:48 UTC] felipe@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-03-30 17:30 UTC] oorza2k5 at gmail dot com
It works as expected in the latest CVS under Windows... I don't have a non-production Linux install to test with, so if someone else could verify it's fixed in CVS (under Linux), that'd be great.
 [2009-03-30 17:51 UTC] felipe@php.net
It's works. It was fixed days ago. (bug#47769)

Thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 10:01:32 2025 UTC