#36075 [Opn->Bgs]: php4.4.1 constructors are called twice

From: Date: Thu, 19 Jan 2006 00:45:21 +0000
Subject: #36075 [Opn->Bgs]: php4.4.1 constructors are called twice
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92162@lists.php.net to get a copy of this message
ID: 36075 Updated by: tony2001@php.net Reported By: koukine at gmail dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Windows XP Pro SP2 PHP Version: 4.4.2 New Comment: PHP doesn't call parent constructors at all (and this is expected). Did you actually run this code? It produces only "BBB; ". Previous Comments: ------------------------------------------------------------------------ [2006-01-19 01:35:29] koukine at gmail dot com Description: ------------ 1. Parent constructor should be called first 2. This class consutructor shold be called once Reproduce code: --------------- <? class A{ function A(){ print("AAA; "); } } class B extends A{ function B(){ print("BBB; "); } } $b = &new B(); ?> Expected result: ---------------- AAA;BBB Actual result: -------------- BBB; AAA; BBB; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36075&edit=1

« previous php.bugs (#92162) next »