ID: 28269
User updated by: phpbug at gb404 dot com
Reported By: phpbug at gb404 dot com
Status: Open
Bug Type: Zend Engine 2 problem
-Operating System: Gentoo Linux 2.4.23
+Operating System: *
PHP Version: 5.0.0RC2
New Comment:
This is not specific to linux
Previous Comments:
------------------------------------------------------------------------
[2004-05-04 03:43:23] phpbug at gb404 dot com
Description:
------------
When I try to instantiate a class which extends an abstract class but
without implemented all defined abstract functions, this class becomes
abstract too and fatal error message returned doesn't give any reason.
Then it is very difficult to find which abstract function is not
implemented as defined in the abstract parent class when there is a lot
of abstract functions to implement.
Is it possible to display a list of the missing function after the
actual error message ?
Reproduce code:
---------------
<?php
abstract class a
{
abstract function foo();
abstract function bar();
}
class b extends a
{
function foo() {
return "I am the foo function";
}
}
$obj = new b();
?>
Expected result:
----------------
Fatal error: Cannot instantiate class b, abstract function parent::bar
not implemented in /absolute/path/to/my/file/b.php on line 15
Actual result:
--------------
Fatal error: Cannot instantiate abstract class b in
/absolute/path/to/my/file/b.php on line 15
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28269&edit=1