From: chauhansudhir at fastmail dot in Operating system: Win XP PHP version: 5.2.3 PHP Bug Type: Feature/Change Request Bug description: Inheritance problem
Description: ------------ When we inherit classes and creates an object of derieved class the constructor of parent classes are not executed we need to execute this explicitly. Please check the following code Reproduce code: --------------- <?php abstract class a { function __construct() { print "a"; } } class b extends a { function __construct() { print "b"; } } class c extends b { function __construct() { print "c"; } } $v = new c(); ?> Expected result: ---------------- abc but it ab getting on c why so? as inheritance moves form parent to child same as java. Actual result: -------------- c -- Edit bug report at http://bugs.php.net/?id=42370&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42370&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42370&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42370&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42370&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42370&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42370&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42370&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42370&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42370&r=support Expected behavior: http://bugs.php.net/fix.php?id=42370&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42370&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42370&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42370&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42370&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42370&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42370&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42370&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42370&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42370&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42370&r=mysqlcfg