1.2.435. Exit-like Methods

Those methods terminate the execution.

They are detected when they do call exit() or die(). They may also be identified with the PHP 8.0 #[NoReturn] attribute, or the PHPdoc @noreturn (case insensitive).

If they are called, they will stop the application. They are a user-land equivalent of exit() or die().

<?php

// This function anytime the code has finished its processing.
function finish() {
    global $html;

    echo $html;
    die();
}

?>

See also PhpStorm 2020.3 EAP #4: Custom PHP 8 Attributes.

1.2.435.1. Specs

Short name

Functions/KillsApp

Rulesets

All, Attributes, CE

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Medium

Features

exit

Available in

Entreprise Edition, Community Edition, Exakat Cloud