Re: Parameter type widening RFC
| From: | lists@rhsoft.net | Date: | Sun, 28 May 2017 21:33:22 +0000 |
| Subject: | Re: Parameter type widening RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99219@lists.php.net to get a copy of this message | ||
Am 28.05.2017 um 23:28 schrieb Dan Ackroyd:
On 28 May 2017 at 18:06, Aidan Woods <aidantwoods@gmail.com> wrote:all these things should be just warnings instead fatal errors no matter if we talk about params or return-types simply because any sane code over years had types in the doc-block comments and now with throw fatal errors you just make it only harder move that comment hints to codeSo, if I understand everything here correctly ... will be equivalent in 7.2? :(Not equivalent. Adding the Boo param type to an implementation, when it is only a comment in the parent gives an error. interface Foo { /** @param $Boo, pretty please accept type Boo here */public function bar( $Boo); } class Zot implements Foo {public function bar(Boo $Boo) {}} Fatal error: Declaration of Zot::bar(Boo $Boo) must be compatible with Foo::bar($Boo) in %s on line %d