#20784 [Opn->Bgs]: __construct doesn't get called
| From: | derick@php.net | Date: | Tue, 03 Dec 2002 11:00:59 +0000 |
| Subject: | #20784 [Opn->Bgs]: __construct doesn't get called | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26488@lists.php.net to get a copy of this message | ||
ID: 20784
Updated by: derick@php.net
Reported By: jalonso@art3mis.com
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: Debian Linux
PHP Version: 4.3.0RC2
New Comment:
4.3.0RC2 doesn't come with Zend Engine 2; from PHP 5 on this will be
the used engine.
not a bug -> bogus
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-12-03 05:00:38] jalonso@art3mis.com
<?php
echo phpversion().chr(10);
class BaseClass {
function __construct() {
print "In BaseClass constructor\n";
}
}
class SubClass extends BaseClass {
function __construct() {
parent::__construct();
print "In SubClass constructor\n";
}
}
$obj = new BaseClass();
$obj = new SubClass();
?>
This example ( taken from:
http://www.php.net/source.php?url=/zend2_example.phps
)
gives me the following output:
--output--
4.3.0RC2
----------
So __construct() doesn't seem to be called.
If I rename __construct() on BaseClass class to BaseClass() i get this
output:
--output--
4.3.0RC2
In BaseClass constructor
In BaseClass constructor
----------
------------------------------------------------------------------------
[2002-12-03 04:59:27] jalonso@art3mis.com
<?php
echo phpversion().chr(10);
class BaseClass {
function __construct() {
print "In BaseClass constructor\n";
}
}
class SubClass extends BaseClass {
function __construct() {
parent::__construct();
print "In SubClass constructor\n";
}
}
$obj = new BaseClass();
$obj = new SubClass();
?>
This example ( taken from:
http://www.php.net/source.php?url=/zend2_example.phps
)
gives me the following output:
--output--
4.3.0RC2
----------
So __construct() doesn't seem to be called.
If I rename __construct to BaseClass i get this output:
--output--
4.3.0RC2
In BaseClass constructor
In BaseClass constructor
----------
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20784&edit=1