#29780 [Fbk-Opn]: Constructor isn't called if a class is extended from a built in class
ID: 29780 User updated by: d dot khan at ventigo dot com Reported By: d dot khan at ventigo dot com -Status: Feedback +Status: Open Bug Type: Unknown/Other Function Operating System: * PHP Version: 5.* New Comment: weird. PHP Version 5.0.1 PDO: Version 0.1.1 Release Date2004-05-21 PDO_MYSQL: Version 0.1 Release Date2004-05-18 Spits out that error. Previous Comments: [2004-08-29 08:10:08] [EMAIL PROTECTED] Works fine for me with latest PHP and PDO. Btw, this is not ZE problem, reclassifying. [2004-08-26 20:32:26] [EMAIL PROTECTED] HINT to all extension developers: Constructors of internal classes need to have the name '__construct' rather that the class's name. [2004-08-25 22:46:08] d dot khan at ventigo dot com You example works - mine doesn't. It seems to be an oddity with extensions... Example code: ?php class test extends stdClass { function __construct() { echo 'Called in child'; } } $test = new test; Class rltxPDO extends PDO { function __construct() { echo 'Called in child 2'; } } $test2 = new rltxPDO; ? Output: Called in child Warning: PDO::__construct() expects at least 1 parameter, 0 given in /home/shares/development/khan/wandern/html/test.php on line 19 [2004-08-23 18:20:12] [EMAIL PROTECTED] This code: ? class test extends stdClass { function __construct() { echo 'Called in child'; } } $test = new test; ? works fine and outputs 'Called in child' for me. Please, check it one more time and/or try newer snapshot. [2004-08-21 11:58:01] d dot khan at ventigo dot com Description: Hello, maybe this is bogus but I found a situation where the OOP engine doesn't behave as - at least I - would expect. I tried to extend the PDO extension and my local construct method isn't called. The engine always calls the parent construct method. Greetings Daniel Khan Reproduce code: --- Class rltxPDO extends PDO { function __construct() { echo 'Called in child'; } public static function instance() { static $instance; if (!$instance) { $instance = new rltxPDO(); } return $instance; } } Expected result: Output: Called in child Actual result: -- Warning: PDO::__construct() expects at least 1 parameter, 0 given -- Edit this bug report at http://bugs.php.net/?id=29780edit=1
#29780 [Fbk-Opn]: Constructor isn't called if a class is extended from a built in class
ID: 29780 User updated by: d dot khan at ventigo dot com Reported By: d dot khan at ventigo dot com -Status: Feedback +Status: Open Bug Type: Zend Engine 2 problem Operating System: Linux (Gentoo) PHP Version: 5.0.1 New Comment: You example works - mine doesn't. It seems to be an oddity with extensions... Example code: ?php class test extends stdClass { function __construct() { echo 'Called in child'; } } $test = new test; Class rltxPDO extends PDO { function __construct() { echo 'Called in child 2'; } } $test2 = new rltxPDO; ? Output: Called in child Warning: PDO::__construct() expects at least 1 parameter, 0 given in /home/shares/development/khan/wandern/html/test.php on line 19 Previous Comments: [2004-08-23 18:20:12] [EMAIL PROTECTED] This code: ? class test extends stdClass { function __construct() { echo 'Called in child'; } } $test = new test; ? works fine and outputs 'Called in child' for me. Please, check it one more time and/or try newer snapshot. [2004-08-21 11:58:01] d dot khan at ventigo dot com Description: Hello, maybe this is bogus but I found a situation where the OOP engine doesn't behave as - at least I - would expect. I tried to extend the PDO extension and my local construct method isn't called. The engine always calls the parent construct method. Greetings Daniel Khan Reproduce code: --- Class rltxPDO extends PDO { function __construct() { echo 'Called in child'; } public static function instance() { static $instance; if (!$instance) { $instance = new rltxPDO(); } return $instance; } } Expected result: Output: Called in child Actual result: -- Warning: PDO::__construct() expects at least 1 parameter, 0 given -- Edit this bug report at http://bugs.php.net/?id=29780edit=1
#29780 [NEW]: Constructor isn't called if a class is extended from a built in class
From: d dot khan at ventigo dot com Operating system: Linux (Gentoo) PHP version: 5.0.1 PHP Bug Type: Zend Engine 2 problem Bug description: Constructor isn't called if a class is extended from a built in class Description: Hello, maybe this is bogus but I found a situation where the OOP engine doesn't behave as - at least I - would expect. I tried to extend the PDO extension and my local construct method isn't called. The engine always calls the parent construct method. Greetings Daniel Khan Reproduce code: --- Class rltxPDO extends PDO { function __construct() { echo 'Called in child'; } public static function instance() { static $instance; if (!$instance) { $instance = new rltxPDO(); } return $instance; } } Expected result: Output: Called in child Actual result: -- Warning: PDO::__construct() expects at least 1 parameter, 0 given -- Edit bug report at http://bugs.php.net/?id=29780edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29780r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29780r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29780r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29780r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29780r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29780r=needscript Try newer version: http://bugs.php.net/fix.php?id=29780r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=29780r=support Expected behavior: http://bugs.php.net/fix.php?id=29780r=notwrong Not enough info:http://bugs.php.net/fix.php?id=29780r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=29780r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29780r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29780r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29780r=dst IIS Stability: http://bugs.php.net/fix.php?id=29780r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=29780r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29780r=float