3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pipe(mixed $arg, callable ...$fns): mixed { foreach ($fns as $fn) { $arg = $fn($arg); } return $arg; } function a($v) { return $v; } function b($v) { return $v; } function c($v) { return $v; } function d($v) { return $v; } print pipe('hello', a(...), b(...), c(...), d(...));
Output for 8.1.0 - 8.1.1
hello
Output for 8.0.1 - 8.0.14
Parse error: syntax error, unexpected token ")" in /in/Bg2F1 on line 16
Process exited with code 255.
Output for 7.4.0 - 7.4.27
Parse error: syntax error, unexpected ')' in /in/Bg2F1 on line 16
Process exited with code 255.

preferences:
184.04 ms | 1399 KiB | 49 Q