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.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14, 8.4.1
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:
38.2 ms | 407 KiB | 5 Q