|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34590 User defined PDOStatement class can't implement methods
Submitted: 2005-09-21 22:15 UTC Modified: 2005-09-22 01:01 UTC
From: php dot net at benjamin dot schulz dot name Assigned: helly (profile)
Status: Closed Package: PDO related
PHP Version: 5CVS-2005-09-21 (CVS) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php dot net at benjamin dot schulz dot name
New email:
PHP Version: OS:


 [2005-09-21 22:15 UTC] php dot net at benjamin dot schulz dot name
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:
$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);

Expected result:

Actual result:
Fatal error: Call to undefined method myStatement::foo() 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-21 22:45 UTC] christian dot mueller at dfpx dot de
Duplicate of

But this on has an much tighter reproduce code.
 [2005-09-22 01:01 UTC]
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
Thank you for the report, and for helping us make PHP better.

Ok fixed now.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 16 19:03:38 2021 UTC