Exit

Exit and dies terminates the current process.

exit is a language construct.

shutdown functions and constructor are still executed after a call to exit.

<?php

class x {
    final const X = 1;
}

?>

Documentation

See also PHP | exit( ) Function

Related : Language construct, Shutdown Function, Destructor

Added in PHP 8.1