3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface TestInterface {} interface FooInterface { public function bar(TestInterface $variable); } class Foo implements FooInterface { public function bar($variable) {} } $foo = new Foo; $foo->bar('test');
based on 7E7jL
Output for 7.2.0
Output for 7.0.0 - 7.1.10
Fatal error: Declaration of Foo::bar($variable) must be compatible with FooInterface::bar(TestInterface $variable) in /in/BZ6bB on line 13
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Fatal error: Declaration of Foo::bar() must be compatible with FooInterface::bar(TestInterface $variable) in /in/BZ6bB on line 14
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Fatal error: Declaration of Foo::bar() must be compatible with that of FooInterface::bar() in /in/BZ6bB on line 14
Process exited with code 255.