#28269 [Com]: Incomplete error message when instantiating child classes of an abstract class

From: Date: Mon, 27 Sep 2004 08:37:17 +0000
Subject: #28269 [Com]: Incomplete error message when instantiating child classes of an abstract class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66750@lists.php.net to get a copy of this message
ID: 28269 Comment by: bobalong at gmx dot net Reported By: phpbug at gb404 dot com Status: Open Bug Type: Feature/Change Request Operating System: * PHP Version: 5.0.2 Assigned To: helly New Comment: Thank you! Keep up the great work! PHP5 is awsome. Previous Comments: ------------------------------------------------------------------------ [2004-09-26 20:39:39] helly@php.net Your last complain is fixed too: marcus@frodo /usr/src/PHP_5_0 $ php -r 'interface foo{function bar();} class baz implements foo{}' make: `sapi/cli/php' is up to date. Fatal error: Class baz contains 1 abstract methods and must therefore be declared abstract (foo::bar) in Command line code on line 1 marcus@frodo /usr/src/PHP_5_0 $ php -v make: `sapi/cli/php' is up to date. PHP 5.0.3-dev (cli) (built: Sep 25 2004 00:37:01) (DEBUG) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.2-dev, Copyright (c) 1998-2004 Zend Technologies ------------------------------------------------------------------------ [2004-09-25 20:16:46] bobalong at gmx dot net Cool, and I'm sure that's not at the top of the priority list. However, in the example above, if foo() is not implemented in class c, no compile error is thrown. The developer must instantiate the class prior to knowing it is abstract. This forces the developer to manually ensure that all abstract members from higher up in an inheritence heirarchy have been implemented. ------------------------------------------------------------------------ [2004-09-25 20:16:06] bobalong at gmx dot net Cool, and I'm sure that's not at the top of the priority list. However, in the example above, if foo() is not implemented in class c, no compile error is thrown. The developer must instantiate the class prior to knowing it is abstract. This forces the developer to manually ensure that all abstract members from higher up in an inheritence heirarchy have been implemented. Is this intentional behaviour? ------------------------------------------------------------------------ [2004-09-25 00:22:21] helly@php.net Abstract redefinition is a feature request - the rest was fixed in 5.0.0 ------------------------------------------------------------------------ [2004-09-25 00:21:59] helly@php.net Abstract redefinition is a feature request - the rest was fixed in 5.0.0 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/28269 -- Edit this bug report at http://bugs.php.net/?id=28269&edit=1

« previous php.bugs (#66750) next »