What returns PHP die ()

in PHP. die()gives something in return when we use it?

+5
source share
6 answers

In PHP, the die () function simply stops running the script and prints an argument (if any).

http://php.net/die

+22
source

Why don't you take a look at the great PHP documentation? It even contains information about die ()

+10
source

, die() exit() script; , :

if (die())) {
    echo 'are we dead yet?';
}

, , () die() exit(), - , , script. cli SAPI, script php /path/to/script.php.

:

die('goodbye cruel world');

goodbye cruel world, 0, , .

:

die(1);

, , 1, , .

, die() - die(0).

, , , . 1 , 2 ..

+8
+2

. script , .

+1

There is no reason to return something in the mind / exit. This function terminates the php interpreter process internally and returns the exit code to the shell. Therefore, after calling die (), the script is not executed, because there is no interpreter process that executes the script, and therefore there is no way to handle the return of the function.

+1
source

All Articles