ID:               42370
 Updated by:       [EMAIL PROTECTED]
 Reported By:      chauhansudhir at fastmail dot in
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Win XP
 PHP Version:      5.2.3
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is how php works, you have to call parent::__construct() yourself.


Previous Comments:
------------------------------------------------------------------------

[2007-08-22 08:36:47] chauhansudhir at fastmail dot in

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 this bug report at http://bugs.php.net/?id=42370&edit=1

Reply via email to