php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34626 Can't extend PDO because __construct is final.
Submitted: 2005-09-24 07:08 UTC Modified: 2005-09-24 20:18 UTC
From: stewey at ambitious dot ca Assigned:
Status: Closed Package: PDO related
PHP Version: 5.1.0RC1 OS: Mac OS X 10.4.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: stewey at ambitious dot ca
New email:
PHP Version: OS:

 

 [2005-09-24 07:08 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-24 11:01 UTC] derick@php.net
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.
 [2005-09-24 20:18 UTC] stewey at ambitious dot ca
Confirmed fixed in latest. Yay!!!
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 09:03:37 2021 UTC