Re: Declaration of Bar::__construct() must be compatible
| From: | Stig S. Bakken | Date: | Fri, 27 Feb 2004 13:39:32 +0000 |
| Subject: | Re: Declaration of Bar::__construct() must be compatible | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8214@lists.php.net to get a copy of this message | ||
On Fri, 2004-02-27 at 14:13, Derick Rethans wrote:
> 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.
What is worse is that many PHP 4 APIs need to be completely redesigned
for PHP 5, not only the guts of the class.
IMHO method overloading the the only clean way out of this.
- Stig