RE: [PHP-DEV] RfC: rethink OO inheritance strictness

From: Date: Wed, 02 Aug 2006 13:28:25 +0000
Subject: RE: [PHP-DEV] RfC: rethink OO inheritance strictness
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-25126@lists.php.net to get a copy of this message
Zeev Suraski <mailto:zeev@zend.com> wrote on Wednesday, August 02, 2006 2:33 PM: > I believe the problem is that 10 years ago we introduced what can be > described as 'loose OO programming', and we're replacing it (instead > of augmenting it) with strict OO programming. Yes - and I personally like this features in PHP that let me develop more strictly. Proposal: 1. Make this BC breakage in 6.0, let it E_STRICT in 5.2 (so 5.1=>5.2 can be upgraded harmlessly). 2. Make it E_FATAL in 6.0 3. BUT let derived constructors change parameters a) as constructors are never called from the parent, but optionally from a child class, it's completely valid IHMO b) constructors are usally not used in object aggregation / setters, but called only _ONCE_ at object creation => the creating code knows the exact (sub-)class and it's constructor. PS: An real-life example from those wo prefer the old behavior would be nice ;-) -soenke

« previous php.internals (#25126) next »