|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-24 18:13 UTC] christian dot mueller at dfpx dot de
[2005-09-21 23:13 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 16:00:01 2025 UTC |
Description: ------------ When i try to override PDO_Statement::execute(), my Method is ignored completly. When i try to implement ::foo() in my extending class, PHP states it is undefined. Reproduce code: --------------- <?php class MTFrame_DB_PDOStatement extends PDOStatement { public function execute() { throw new Exception(); // Nothing happens, i'm ignored } public function foo() { throw new Exception(); // i do not exist? } } class MTFrame_DB_PDO extends PDO { function prepare($sql) { return parent::prepare($sql, array(PDO_ATTR_STATEMENT_CLASS=>array('MTFrame_DB_PDOStatement'))); } function query($sql) { $stmt = parent::prepare($sql, array(PDO_ATTR_STATEMENT_CLASS=>array('MTFrame_DB_PDOStatement'))); $stmt->foo(); return $stmt; } } ?> Actual result: -------------- MTFrame_DB_PDOStatement::execute() gets ignored. calling ::foo() produces: Call to undefined method MTFrame_DB_PDOStatement::foo()