#46396 [Opn->Csd]: __call() not called on classes extending PDOStatement
| From: | johannes@php.net | Date: | Sun, 26 Oct 2008 19:27:22 +0000 |
| Subject: | #46396 [Opn->Csd]: __call() not called on classes extending PDOStatement | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130144@lists.php.net to get a copy of this message | ||
ID: 46396
Updated by: johannes@php.net
Reported By: doctorrock83 at gmail dot com
-Status: Open
+Status: Closed
Bug Type: PDO related
Operating System: Windows XP
PHP Version: 5.2.6
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
This is fixed for some time in CVS now.
Previous Comments:
------------------------------------------------------------------------
[2008-10-26 18:30:14] doctorrock83 at gmail dot com
Description:
------------
When extending PDOStatement, it looks like PHP's engine doesn't know
anything about a possible __call() method into it.
#43663 was the same but for PDO instances
Reproduce code:
---------------
class Mystatement extends PDOStatement
{
public function __call($m, $a)
{
echo "called $m";
}
}
$pdo = new PDO('mysql:host=localhost;dbname=myDB','login','secret');
$pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('Mystatement'));
$s = $pdo->query("SELECT * FROM members"); // should be OK
$s->idontexist();
Expected result:
----------------
called idontexist
Actual result:
--------------
Fatal error: Call to undefined method Mystatement::idontexist() in XXX
on line xxxx
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46396&edit=1