#34626 [Opn->Csd]: Can't extend PDO because __construct is final.
| From: | derick@php.net | Date: | Sat, 24 Sep 2005 09:01:47 +0000 |
| Subject: | #34626 [Opn->Csd]: Can't extend PDO because __construct is final. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85526@lists.php.net to get a copy of this message | ||
ID: 34626
Updated by: derick@php.net
Reported By: stewey at ambitious dot ca
-Status: Open
+Status: Closed
Bug Type: PDO related
Operating System: Mac OS X 10.4.2
PHP Version: 5.1.0RC1
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.
Previous Comments:
------------------------------------------------------------------------
[2005-09-24 07:08:33] stewey at ambitious dot ca
Description:
------------
Unable to extend the PDO class because __construct is final.
Reproduce code:
---------------
class MyPDO extends PDO
{
function __construct($dsn, $user, $pass)
{
parent::__construct($dsn, $user, $pass);
}
}
$PDO = new MyPDO($dsn, $user, $pass);
Expected result:
----------------
I would expect to be able to extend PDO. I realize that this
is intended behavior to avoid a SEGV, but I think that there
are legitimate reasons why people would want to extend PDO. Is
it possible to address this a different way?
Actual result:
--------------
Fatal error: Cannot override final method PDO::__construct()
in myfile on line myline
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34626&edit=1