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)"); + +?> + + +