Re: Declaration of Bar::__construct() must be compatible

From: Date: Fri, 27 Feb 2004 13:13:11 +0000
Subject: Re: Declaration of Bar::__construct() must be compatible
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-8210@lists.php.net to get a copy of this message
On Fri, 27 Feb 2004, Andi Gutmans wrote: > d) Last problem is that using E_STRICT is not a good idea because we find > this problem at compile-time and the error_reporting might not be set yet. The INI system is 'booted' before the script is compiled, so I doubt that this is a problem. > What I suggest is the following: > a) Don't check signature for constructors. > b) By default, don't check signature for inheritance *if* we're not > inheriting from an abstract class. If it is an abstract class we should > check the signature because it's a PHP 5 feature. ack and ack > c) Add a new INI option (zend.strict_inheritance_checks) which does check > signature for methods (except for constructor). I don't like new INI > options but I don't think there's any way out. I'm against adding another INI setting. I don't see why we need to force this OO purist thing on all long time users at all. What is wrong by showing an e_notice/e_warning for it in non-compat mode, and e_strict in compat mode (or just e_strict in both cases)? Then PHP still tells you that you do something wrong, but it won't break any code. Derick

« previous php.internals (#8210) next »