#22675 [Opn->Bgs]: Bug? Feature? Classes and Contructors
ID: 22675
Updated by: mgf@php.net
Reported By: d dot freise at gmx dot de
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: SuSE Linux 8.1/i386
PHP Version: 4.3.1
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 documented at
http://www.php.net/manual/en/language.oop.constructor.php
-- see the
"Caution" box near the bottom.
Previous Comments:
------------------------------------------------------------------------
[2003-03-13 08:34:40] d dot freise at gmx dot de
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22675&edit=1
Thread (2 messages)