|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-03-13 09:00 UTC] mgf@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
Hi! I'm not a 100% certain if this is a bug, but it made me think of it... Here is some sample code: --- class A { var $test; function A() { $this->test = 1; } } class B extends A { function B() {} function out() { echo $this->test; } } $test = &new B; $test->out(); --- The abose sample will output "" - an empty string. I found out that the contructor of class A is never called. I'm programing a lot with C++ and find this behaviour odd. All contructors of derived classes should be called. I searched the bug database and found bug #1856 - rather old - telling me that it should be fixed in CVS that times. If this an intended behaviour, please excuse me for disturbing ;-) Dennis Freise