3v4l.org

run code in 200+ PHP versions simultaneously
<?php class ParentClassBackCompat { public function walk($param1, $param2) {} } class ChildClassBackCompat extends ParentClassBackCompat { function walk($param1, $param2, ...$spread) {} } class ParentClass { public function walk($param1, $param2, ...$spread) {} } class ChildClass extends ParentClass { function walk($param1, $param2, $param3, ...$spread) {} }
based on 2gltn
Output for 7.4.0
Warning: Declaration of ChildClass::walk($param1, $param2, $param3, ...$spread) should be compatible with ParentClass::walk($param1, $param2, ...$spread) in /in/5oNs4 on line 16
Output for 7.0.0 - 7.3.7
Warning: Declaration of ChildClass::walk($param1, $param2, $param3, ...$spread) should be compatible with ParentClass::walk($param1, $param2, ...$spread) in /in/5oNs4 on line 17
Output for 5.6.0 - 5.6.40
Strict Standards: Declaration of ChildClass::walk() should be compatible with ParentClass::walk($param1, $param2, ...$spread) in /in/5oNs4 on line 17
Output for 5.4.0 - 5.5.38
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/5oNs4 on line 8
Process exited with code 255.
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/5oNs4 on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '.', expecting '&' or T_VARIABLE in /in/5oNs4 on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/5oNs4 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/5oNs4 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/5oNs4 on line 4
Process exited with code 255.