3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function callWithArgs(callable $callback, ...$args) { return function(...$params) use($callback, $args) { $args = array_merge($params, $args); return $callback(...$args); } } $t = callWithArgs('substr', 0, 5); $string = 'Lorem ipsum dolor simet'; var_dump( $t($string) ); // "Lorem"
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '}', expecting ';' in /in/ssCsb on line 9
Process exited with code 255.
Output for 5.6.8 - 5.6.17
Parse error: syntax error, unexpected '}' in /in/ssCsb on line 9
Process exited with code 255.
Output for 5.4.11 - 5.5.31
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/ssCsb on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/ssCsb on line 3
Process exited with code 255.