3v4l.org

run code in 500+ PHP versions simultaneously
<?php try { exit(new stdClass); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Passed the exit()";
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
TypeError: exit(): Argument #1 ($status) must be of type string|int, stdClass given Passed the exit()
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
Error: Object of class stdClass could not be converted to string Passed the exit()

preferences:
58.92 ms | 982 KiB | 4 Q