|  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
 [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-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 03 09:03:39 2023 UTC