3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace V1 { interface Foo { public function merge(Foo $foo); } } namespace V2 { interface Foo extends \V1\Foo { } } namespace { use V2\Foo; // use V1\Foo; class FooImpl implements Foo { public function merge(Foo $foo) { // ... } } $fooImpl1 = new FooImpl; $fooImpl2 = new FooImpl; $fooImpl1->merge($fooImpl2); }
based on 8N8bJ
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of FooImpl::merge(V2\Foo $foo) must be compatible with V1\Foo::merge(V1\Foo $foo) in /in/I2gkY on line 20
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Declaration of FooImpl::merge() must be compatible with V1\Foo::merge(V1\Foo $foo) in /in/I2gkY on line 21
Process exited with code 255.