note 109039 deleted from language.oop5.inheritance by danbrown
| From: | danbrown@php.net | Date: | Fri, 15 Jun 2012 15:59:13 +0000 |
| Subject: | note 109039 deleted from language.oop5.inheritance by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188634@lists.php.net to get a copy of this message | ||
Note Submitter: miguel dot perez at afina dot es
----
You can't redefine methods in inherited classes with a different arity (which makes a lot of
sense in many situations, including but not limiting to variable arguments). It's not even a
limitation of the Zend engine; it just throws an E_STRICT on purpose because somewhere, somebody
thought this should not be possible and liked limitations. WHY OH WHY.
This object system is a toy which combines the disadvantages of Python with the disadvantages of
Java, as well as some new ones that didn't exist in either. It looks passable â not even
good, too much noise and too Javish â when you do a toy example like class Worker extends
Person, but as soon as you get into real applications and frameworks... good luck calling a callable
property, redefining class methods or properties, giving dynamic default values (such as
function(){}) to properties in class definitions, and so on.