3v4l.org

run code in 300+ PHP versions simultaneously
<?php function suppress(...$suppressedExceptions) { $fn = function (\Throwable $t) use ($suppressedExceptions) { forach ($suppressedExceptions as $suppressedException) { if ($t instanceof $suppressedException) { return; } } throw $t; }; return $fn; } $fn = suppress("\Exception"); $fn(new StdClass);
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected 'as' (T_AS), expecting ',' or ')' in /in/QQ2OP on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.16
Parse error: syntax error, unexpected 'as' (T_AS) in /in/QQ2OP on line 5
Process exited with code 255.
Output for 5.5.24 - 5.5.30
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/QQ2OP on line 3
Process exited with code 255.

preferences:
172.77 ms | 1395 KiB | 26 Q