Re: Parameter type widening RFC

From: Date: Sun, 28 May 2017 21:28:33 +0000
Subject: Re: Parameter type widening RFC
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-99218@lists.php.net to get a copy of this message
On 28 May 2017 at 18:06, Aidan Woods <aidantwoods@gmail.com> wrote: > So, 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 cheers Dan

« previous php.internals (#99218) next »