Try our affiliated browser extension - redirect to BreezeWiki automatically!

Die

The title of this article should be die(), but due to technical restrictions, cannot contain parenthesis.

Equivalent to exit().

This function is a language construct.

Arguments

void die ({{{params}}})


void die ({{{params}}})


Argument Inclusion

(PHP 3, PHP 4, PHP 5)

Examples

Example 1:

 
 <?php
 $filename = '/path/to/sample_file';
 $file = fopen($filename, 'r')
   or die("cannot open file ($filename)");
 ?>

Output

Cannot open file sample_file

Example 2:

 <?php
 die('Output this sample error message.');
 ?>

Output

Output this sample error message.
For more details on this function, visit its entry in the php manual.