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.22, 8.5.0 - 8.5.7
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.31, 8.3.0 - 8.3.31
Error: Object of class stdClass could not be converted to string Passed the exit()

preferences:
69.1 ms | 1020 KiB | 4 Q