#34626 [NEW]: Can't extend PDO because __construct is final.

From: Date: Sat, 24 Sep 2005 05:08:35 +0000
Subject: #34626 [NEW]: Can't extend PDO because __construct is final.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85524@lists.php.net to get a copy of this message
From: stewey at ambitious dot ca Operating system: Mac OS X 10.4.2 PHP version: 5.1.0RC1 PHP Bug Type: PDO related Bug description: Can't extend PDO because __construct is final. 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 bug report at http://bugs.php.net/?id=34626&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34626&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34626&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34626&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34626&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34626&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34626&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34626&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34626&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34626&r=support Expected behavior: http://bugs.php.net/fix.php?id=34626&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34626&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34626&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34626&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34626&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34626&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34626&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34626&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34626&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34626&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34626&r=mysqlcfg

« previous php.bugs (#85524) next »