3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $x = [ 2, 3, 0, 4]; usort($x, fn($a, $b) => $a/$b); } catch (\Throwable $e) { var_dump(serialize($e)); }
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in /in/PGKnl:8 Stack trace: #0 /in/PGKnl(8): serialize(Object(DivisionByZeroError)) #1 {main} thrown in /in/PGKnl on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Division by zero in /in/PGKnl on line 5

preferences:
124.66 ms | 401 KiB | 121 Q