mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
- Document 2nd parameter to set_error_handler
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150711 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3690711874
commit
943e655fc9
1 changed files with 19 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.18 $ -->
|
||||
<!-- $Revision: 1.19 $ -->
|
||||
<!-- splitted from ./en/functions/errorfunc.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.set-error-handler">
|
||||
<refnamediv>
|
||||
|
@ -13,6 +13,7 @@
|
|||
<methodsynopsis>
|
||||
<type>string</type><methodname>set_error_handler</methodname>
|
||||
<methodparam><type>callback</type><parameter>error_handler</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>error_types</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Sets a user function (<parameter>error_handler</parameter>) to handle
|
||||
|
@ -23,6 +24,16 @@
|
|||
or when you need to trigger an error under certain conditions (using
|
||||
<function>trigger_error</function>).
|
||||
</para>
|
||||
<para>
|
||||
The second parameter <parameter>error_types</parameter> was introduced in
|
||||
PHP 5 and can be used to mask the triggering of the
|
||||
<parameter>error_handler</parameter> function just like the <link
|
||||
linkend="ini.error-reporting">error_reporting</link> ini setting controls
|
||||
which errors are shown. Without this mask set the
|
||||
<parameter>error_handler</parameter> will be called for every error
|
||||
unregardless to the setting of the <link
|
||||
linkend="ini.error-reporting">error_reporting</link> setting.
|
||||
</para>
|
||||
<para>
|
||||
The user function needs to accept two parameters: the error code, and a
|
||||
string describing the error. From PHP 4.0.2, three optional
|
||||
|
@ -137,7 +148,7 @@ $d = scale_by_log($a, -2.5);
|
|||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
And when you run this sample script, the output will be :
|
||||
And when you run this sample script, the output will be:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
|
@ -197,6 +208,12 @@ Aborting...<br />
|
|||
error handler cannot be called since it is not registered at that time.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
The second parameter <parameter>error_types</parameter> was introduced
|
||||
in PHP 5.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>error_reporting</function>,
|
||||
<function>restore_error_handler</function>,
|
||||
|
|
Loading…
Reference in a new issue