3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { public function foobar($a) { } } class bar extends foo { public function foobar($a, $b = null) { } } class baz extends foo { public function foobar($a, $b) { } } (new bar)->foobar(1, 2); (new baz)->foobar(1, 2);
based on NqQg2
Output for 7.0.0 - 7.2.0
Warning: Declaration of baz::foobar($a, $b) should be compatible with foo::foobar($a) in /in/ZffJ8 on line 21
Output for 5.4.11 - 5.6.28
Strict Standards: Declaration of baz::foobar() should be compatible with foo::foobar($a) in /in/ZffJ8 on line 21
Output for 5.3.21 - 5.3.29
Strict Standards: Declaration of baz::foobar() should be compatible with that of foo::foobar() in /in/ZffJ8 on line 21 Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/ZffJ8 on line 24
Process exited with code 255.