Re: No inheritance check in constructor ?
| From: | Jean-Sébastien H. | Date: | Fri, 28 Oct 2011 15:33:34 +0000 |
| Subject: | Re: No inheritance check in constructor ? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55983@lists.php.net to get a copy of this message | ||
Ok it's a documented behaviour, I should read more carefully.
http://php.net/manual/en/language.oop5.decon.php
Unlike with other methods, PHP will not generate an E_STRICT level
error message when __construct() is overridden with different parameters
than the parent __construct() method has.
But I think, it's a lack in PHP ?
On Fri, 28 Oct 2011 17:22:53 +0200, Jean-Sébastien H.
<jeanseb@au-fil-du.net> wrote:
> Hi,
>
> Is it an expected behaviour ?
>
> See attached test file.
>
>
> ---- EXPECTED OUTPUT
> Strict Standards: Declaration of ObjChild::method() should be
> compatible with that of ObjParent::method() in %s on line 15
>
> Strict standards: Declaration of ObjChild::__construct() should be
> compatible with that of ObjParent::__construct() in %s on line 17
> ---- ACTUAL OUTPUT
> Strict Standards: Declaration of ObjChild::method() should be
> compatible with that of ObjParent::method() in %s on line 15
>
> ---- FAILED
>
>
>
> NB :
> The real actual output of the phpt is empty. Can we test strict error
> with run-tests ?
>
>
> Regards,
> --
> Jean-Sébastien H.
> au-fil-du.net
--
Jean-Sébastien H.
au-fil-du.net