Re: Declaration of Bar::__construct() must be compatible with that of Foo::__construct()
| From: | Zeev Suraski | Date: | Fri, 27 Feb 2004 04:39:25 +0000 |
| Subject: | Re: Declaration of Bar::__construct() must be compatible with that of Foo::__construct() | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8194@lists.php.net to get a copy of this message | ||
At 03:28 26/02/2004, Derick Rethans wrote:
On Thu, 26 Feb 2004, Marcus Boerger wrote: Hello Timm, well for normal methods we must do that. The derived class must support the same signature that the base class supports. In you example that would only work if the derived method would have a default parameter for the additional parameter: I think this is only annoying users for nothing... I really don't see a good reason on why to enforce this.PHP 5 has grown to depend on the is_a concept as a foundation building block. Allowing people to break is a bad idea, since it makes some of the new features less powerful/reliable. Preventing it now is the right thing to do. E_STRICT may be good for when compat mode's off. Zeev