search for in the  
<definedeval>
Last updated: Thu, 19 May 2005

die

(no version information, might be only in CVS)

die -- Equivalent to exit()

Description

This language construct is equivalent to exit().



User Contributed Notes
die
matt at hehe dot gov
21-Mar-2005 10:17
If you want to issue die on a file that is inside an include, it will keep everything else from running through and finishing.
You can prevent this by using return;. It ends the current file but lets the others keep going.
28-Sep-2004 11:36
Perhaps the Coldfusion query below can be answered as follows:
---------
(From the "User Contributed Notes" for the PHP construct "exit")

nospam at mydomain dot com
27-Sep-2004 10:12
Using return instead of exit is to prefer when you want the script that you have included inside another script to die but continue to execute the main script.
// Radcliff
---------
louis āt mulliemedia.com
23-Jun-2004 01:13
In regards to xagent_ at hotmail dot com
03-Sep-2002 05:22

A useful way of preventing this is to wrap the die function :

<?php
function die_script($errmsg)
{
 print
$errmsg . "</body></html>";
 die;
}
?>
20-Apr-2004 12:46
die(__LINE__); won't say the line number because die() wants a string. do die(''.__LINE__); or die(__FUNCTION__ . ':' . __LINE);
matthias dot schniedermeyer at telefonica dot de
14-Oct-2003 09:29
To get a perl-like die you can/should append this snipped
 . " File: " . __FILE__ . " on line: " . __LINE__
e.g.
die ("Error" . " File: " . __FILE__ . " on line: " . __LINE__);
xagent_ at hotmail dot com
03-Sep-2002 07:22
Note that using the die() function will stop the entire script after that point from being run, so if you issue the die function within a open HTML tag, the HTML tag will remain open, which can seriously effect the browsers output to the user, expecially if its used inside an open <TABLE> tag.

<definedeval>
 Last updated: Thu, 19 May 2005
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: The Server Pages
Last updated: Thu May 19 17:35:34 2005 CDT