Edit report at https://bugs.php.net/bug.php?id=38569&edit=1
ID: 38569
Comment by: dagguh at gmail dot com
Reported by: psykora at gmail dot com
Summary: override keyword requested
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Irrelevant
PHP Version: 5.1.5
Block user comment: N
Private report: N
New Comment:
This is a valid feature request.
If this change is implemented, the override keyword SHOULD be mandatory for
overridden methods, but this way backwards compatibility would be broken.
Previous Comments:
------------------------------------------------------------------------
[2007-12-12 19:52:41] michael at dmgx dot com
Agreed. Currently I use a comment to place the word there just to help myself
out visually. I.E.
public /*override*/ function foo () {}
Override shouldn't be required per se - but if used it should throw an error
when the parent method doesn't exist.
BTW, this has been added to Actionscript 3 which is where I first saw it. Adobe
mentions having the keyword helps out their compiler - so maybe the Zend Engine
could make use of the keyword as well.
------------------------------------------------------------------------
[2006-08-23 15:24:19] psykora at gmail dot com
Description:
------------
The override keyword (f.e. like C#.NET has) could be usefull for specifing to
compiler, that current method is overriding parent's class method.
Compiler then should throw Fatal Error when there is no parent's method for
override.
This could resolve common mistakes when developer changes (or removes) abstract
method from parent's class.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=38569&edit=1