#34590 [Fbk->Csd]: User defined PDOStatement class can't implement methods
| From: | helly@php.net | Date: | Wed, 21 Sep 2005 23:01:15 +0000 |
| Subject: | #34590 [Fbk->Csd]: User defined PDOStatement class can't implement methods | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85409@lists.php.net to get a copy of this message | ||
ID: 34590
Updated by: helly@php.net
Reported By: php dot net at benjamin dot schulz dot name
-Status: Feedback
+Status: Closed
Bug Type: PDO related
-Operating System: linux
+Operating System: *
PHP Version: 5CVS-2005-09-21 (CVS)
Assigned To: helly
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.
Ok fixed now.
Previous Comments:
------------------------------------------------------------------------
[2005-09-22 00:25:52] helly@php.net
what's the output of:
var_dump($r);
infront of:
var_dump($r->foo());
------------------------------------------------------------------------
[2005-09-21 23:13:46] sniper@php.net
Marcus, fix.
------------------------------------------------------------------------
[2005-09-21 22:45:57] christian dot mueller at dfpx dot de
Duplicate of http://bugs.php.net/bug.php?id=34235
But this on has an much tighter reproduce code.
------------------------------------------------------------------------
[2005-09-21 22:15:04] php dot net at benjamin dot schulz dot name
Description:
------------
When using PDO::ATTR_STATEMENT_CLASS the statement object is an object
of the user defined class but it's not possible to access it's
(non-pdo) methods
Reproduce code:
---------------
<?php
$pdo = new PDO("pgsql:user=zrm dbname=zrm host=localhost");
class myStatement extends PDOStatement
{
function foo()
{
echo __METHOD__;
}
}
$opts = array();
$opts[PDO::ATTR_STATEMENT_CLASS] = array('myStatement');
$r = $pdo->prepare('SELECT login_id FROM logins', $opts);
var_dump($r->foo());
?>
Expected result:
----------------
myStatement::foo()
Actual result:
--------------
Fatal error: Call to undefined method myStatement::foo()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34590&edit=1