note 109039 added to language.oop5.inheritance

From: Date: Fri, 15 Jun 2012 08:13:41 +0000
Subject: note 109039 added to language.oop5.inheritance
Groups: php.notes 
Request: Send a blank email to php-notes+get-188619@lists.php.net to get a copy of this message
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. ---- Server IP: 80.64.47.13 Probable Submitter: 217.125.117.197 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.inheritance.php Edit -- https://master.php.net/note/edit/109039 Del: integrated -- https://master.php.net/note/delete/109039/integrated Del: useless -- https://master.php.net/note/delete/109039/useless Del: bad code -- https://master.php.net/note/delete/109039/bad+code Del: spam -- https://master.php.net/note/delete/109039/spam Del: non-english -- https://master.php.net/note/delete/109039/non-english Del: in docs -- https://master.php.net/note/delete/109039/in+docs Del: other reasons-- https://master.php.net/note/delete/109039 Reject -- https://master.php.net/note/reject/109039 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#188619) next »