Edit report at https://bugs.php.net/bug.php?id=55864&edit=1
ID: 55864
Comment by: dagguh at gmail dot com
Reported by: dagguh at gmail dot com
Summary: Explicit call to default constructor
Status: Open
Type: Bug
Package: Class/Object related
Operating System: Irrelevant
PHP Version: 5.3SVN-2011-10-07 (SVN)
Block user comment: N
Private report: N
New Comment:
PS. Actually my PHP version is 5.3.5
Previous Comments:
------------------------------------------------------------------------
[2011-10-07 09:20:34] dagguh at gmail dot com
Description:
------------
You cannot call default constructor from derived class.
Test script:
---------------
<?
class Base {
}
class Derived extends Base {
function __construct($foo) {
parent::__construct();
echo $foo;
}
}
$derived = new Derived("baz");
Expected result:
----------------
baz
Actual result:
--------------
Fatal error: Cannot call constructor
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55864&edit=1