From a7ab91727a3d509f3f84837389b9d450a5cc8bbe Mon Sep 17 00:00:00 2001 From: jim winstead Date: Fri, 28 Sep 2001 20:18:00 +0000 Subject: [PATCH] die is just an alias for exit, so document it that way. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@58670 c90b9560-bf6c-de11-be94-00142212c4b1 --- appendices/aliases.xml | 7 +++- functions/misc.xml | 91 ++++++++++-------------------------------- 2 files changed, 26 insertions(+), 72 deletions(-) diff --git a/appendices/aliases.xml b/appendices/aliases.xml index ee51079831..a15f5ff735 100755 --- a/appendices/aliases.xml +++ b/appendices/aliases.xml @@ -1,5 +1,5 @@ - + Aliases list @@ -198,6 +198,11 @@ ccvs_void CCVS + + die + exit + Miscellaneous functions + dir getdir diff --git a/functions/misc.xml b/functions/misc.xml index e9e40a76fd..08c0cd53c2 100644 --- a/functions/misc.xml +++ b/functions/misc.xml @@ -1,5 +1,5 @@ - + Miscellaneous functions Misc. @@ -239,72 +239,6 @@ if (defined("CONSTANT")){ // Note that it should be quoted - - - die - - Output a message and terminate the current script - - - - Description - - - void die - string message - - - - die outputs message - and terminates parsing of the script. It does not return - anything. - - - Alternatively, die will also accept a - function as a parameter. That function will be executed - before die terminates parsing of the script. - - - - <function>die</function> example - -<?php - -$filename = '/path/to/data-file'; -$file = fopen ($filename, 'r') - or die("unable to open file ($filename)"); - -?> - - - - - - <function>die</function> example using a function - -<?php - -function handle_error($msg) { - if ($fp = @fopen("/tmp/error.log", "a")) { - fwrite($fp, $msg, strlen($msg)); - fclose($fp); - } -} - -if ($bad) { - die(handle_error("Something bad happened.\n")); -} - -?> - - - - - See also exit. - - - - eval @@ -375,24 +309,39 @@ This is a cup with my coffee in it. exit - Terminate current script + Output a message and terminate the current script Description void exit - mixed status + mixed status The exit function terminates execution of the script. It has no return value, but will use - status as its exit status. + status as its exit status, as well as + printing it. - See also die. + Also aliased as die. + + + <function>exit</function> example + +<?php + +$filename = '/path/to/data-file'; +$file = fopen ($filename, 'r') + or exit("unable to open file ($filename)"); + +?> + + +