Overwrite return type-hint into a more specific one
| From: | Marc Bennewitz | Date: | Wed, 01 Apr 2015 18:46:13 +0000 |
| Subject: | Overwrite return type-hint into a more specific one | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-85648@lists.php.net to get a copy of this message | ||
Hi internals,
On experimenting with return type-hints I noted an inconsistency on overwriting an existing hint to a more specific one. On adding a non existing return type-hint on overwrite it's fine but it's logically the same (this previously was an E_STRICT).
http://3v4l.org/YdB8s - works fine (E_STRICT lower then php7@20150401)
http://3v4l.org/UDk0n - Fatal error: Declaration of Bar::setTest() must be compatible with Foo::setTest($test): Foo
http://3v4l.org/AuOsr - HHVM works fine
Marc