php-doc-en/reference/errorfunc/functions/restore-error-handler.xml
2005-04-05 12:00:24 +00:00

80 lines
2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/errorfunc.xml, last change in rev 1.1 -->
<refentry id="function.restore-error-handler">
<refnamediv>
<refname>restore_error_handler</refname>
<refpurpose>
Restores the previous error handler function
</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>restore_error_handler</methodname>
<void/>
</methodsynopsis>
<para>
Used after changing the error handler function using
<function>set_error_handler</function>, to revert to the previous error
handler (which could be the built-in or a user defined function). This
function always returns &true;.
</para>
<para>
See also <function>error_reporting</function>,
<function>set_error_handler</function>,
<function>restore_exception_handler</function>,
<function>trigger_error</function>.
</para>
<para>
<example>
<title>
Decide if <function>unserialize</function> caused an error, then
restore the original error handler.
</title>
<programlisting role="php">
<![CDATA[
<?php
function unserialize_handler($errno, $errstr)
{
echo "Invalid serialized value.\n";
}
$serialized = 'foo';
set_error_handler('unserialize_handler');
$original = unserialize($serialized);
restore_error_handler();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Invalid serialized value.
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->