Update register_shutdown_function documentation

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@319357 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nikita Popov 2011-11-16 18:10:24 +00:00
parent 9ccf307072
commit 88addd0b68

View file

@ -10,14 +10,13 @@
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>register_shutdown_function</methodname>
<methodparam><type>callback</type><parameter>function</parameter></methodparam>
<methodparam><type>callback</type><parameter>callback</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>parameter</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
</methodsynopsis>
<para>
Registers the function named by <parameter>function</parameter> to be
executed when script processing is complete or when <function>exit</function>
is called.
Registers a <parameter>callback</parameter> to be executed after script
execution finishes or <function>exit</function> is called.
</para>
<para>
Multiple calls to <function>register_shutdown_function</function> can be
@ -33,22 +32,14 @@
<para>
<variablelist>
<varlistentry>
<term><parameter>function</parameter></term>
<term><parameter>callback</parameter></term>
<listitem>
<para>
The shutdown function to register.
The shutdown callback to register.
</para>
<para>
The shutdown functions are called as the part of the request so that
it's possible to send the output from them. There is currently no way
to process the data with output buffering functions in the shutdown
function.
</para>
<para>
Shutdown functions are called after closing all opened output buffers
thus, for example, its output will not be compressed if <link
linkend="ini.zlib.output-compression">zlib.output_compression</link> is
enabled.
The shutdown callbacks are executed as the part of the request, so
it's possible to send output from them and access output buffers.
</para>
</listitem>
</varlistentry>
@ -78,6 +69,14 @@
&return.void;
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
If the passed callback is not callable a <constant>E_WARNING</constant>
level error will be generated.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
@ -137,16 +136,6 @@ register_shutdown_function('shutdown');
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Typically undefined functions cause fatal errors in PHP, but when the
<parameter>function</parameter> called with
<function>register_shutdown_function</function> is undefined, an error
of level <constant>E_WARNING</constant> is generated instead. Also,
for reasons internal to PHP, this error will refer to
<literal>Unknown</literal> at line #0.
</para>
</note>
<note>
<para>
Working directory of the script can change inside the shutdown function