3v4l.org

run code in 300+ PHP versions simultaneously
<?php $comething = 42; $closure = function &(string $str) use (&$something) : int { return strlen($str) + $something; } echo $closure("hello");
Output for 7.0.0
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/IvHgT on line 7
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected ':', expecting '{' in /in/IvHgT on line 3
Process exited with code 255.

preferences:
151.31 ms | 1399 KiB | 24 Q