3v4l.org

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