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.24, 8.5.0 - 8.5.9
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.32, 8.3.0 - 8.3.32
Error: Object of class stdClass could not be converted to string Passed the exit()

preferences:
66.18 ms | 1045 KiB | 4 Q