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
This commit is contained in:
jim winstead 2001-09-28 20:18:00 +00:00
parent 71c1619673
commit a7ab91727a
2 changed files with 26 additions and 72 deletions

View file

@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<appendix id="aliases">
<title>Aliases list</title>
<para>
@ -198,6 +198,11 @@
<entry><function>ccvs_void</function></entry>
<entry><link linkend="ref.ccvs">CCVS</link></entry>
</row>
<row>
<entry>die</entry>
<entry><function>exit</function></entry>
<entry><link linkend="ref.misc">Miscellaneous functions</link></entry>
</row>
<row>
<entry>dir</entry>
<entry><function>getdir</function></entry>

View file

@ -1,5 +1,5 @@
<?xml encoding="iso-8859-1"?>
<!-- $Revision: 1.55 $ -->
<!-- $Revision: 1.56 $ -->
<reference id="ref.misc">
<title>Miscellaneous functions</title>
<titleabbrev>Misc.</titleabbrev>
@ -239,72 +239,6 @@ if (defined("CONSTANT")){ // Note that it should be quoted
</refsect1>
</refentry>
<refentry id="function.die">
<refnamediv>
<refname>die</refname>
<refpurpose>
Output a message and terminate the current script
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>die</function></funcdef>
<paramdef>string <parameter>message</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<simpara>
<function>die</function> outputs <parameter>message</parameter>
and terminates parsing of the script. It does not return
anything.
</simpara>
<simpara>
Alternatively, <function>die</function> will also accept a
function as a parameter. That function will be executed
before <function>die</function> terminates parsing of the script.
</simpara>
<para>
<example>
<title><function>die</function> example</title>
<programlisting role="php">
&lt;?php
$filename = '/path/to/data-file';
$file = fopen ($filename, 'r')
or die("unable to open file ($filename)");
?&gt;
</programlisting>
</example>
</para>
<para>
<example>
<title><function>die</function> example using a function</title>
<programlisting role="php">
&lt;?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"));
}
?&gt;
</programlisting>
</example>
</para>
<simpara>
See also <function>exit</function>.
</simpara>
</refsect1>
</refentry>
<refentry id="function.eval">
<refnamediv>
<refname>eval</refname>
@ -375,24 +309,39 @@ This is a cup with my coffee in it.
<refentry id="function.exit">
<refnamediv>
<refname>exit</refname>
<refpurpose>Terminate current script</refpurpose>
<refpurpose>Output a message and terminate the current script</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>exit</function></funcdef>
<paramdef>mixed <parameter>status</parameter></paramdef>
<paramdef>mixed <parameter><optional>status</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
<simpara>
The <function>exit</function> function terminates execution of
the script. It has no return value, but will use
<parameter>status</parameter> as its exit status.
<parameter>status</parameter> as its exit status, as well as
printing it.
</simpara>
<simpara>
See also <function>die</function>.
Also aliased as <function>die</function>.
</simpara>
<para>
<example>
<title><function>exit</function> example</title>
<programlisting role="php">
&lt;?php
$filename = '/path/to/data-file';
$file = fopen ($filename, 'r')
or exit("unable to open file ($filename)");
?&gt;
</programlisting>
</example>
</para>
</refsect1>
</refentry>