exit

PHP 4, PHP 5, PHP 7, PHP 8
exit - Output a message and terminate the current script
Manual
Code Examples

Example #1 Shutdown functions and destructors run regardless

Result: Shutdown: shutdown() Destruct: Foo::__destruct()
PHP Version:

Example #2 exit example

PHP Version:

Example #3 exit status example

PHP Version: