Reword parameter description of set_exception_handler (#1004)

This commit is contained in:
Kamil Tekiela 2022-05-18 17:56:55 +01:00 committed by GitHub
parent 214519fdbd
commit 09f4a3f040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,9 +30,10 @@
<listitem>
<para>
The function to be called when an uncaught exception occurs.
Most errors are reported by throwing <classname>Error</classname>
exceptions, which will be caught by the handler as well. Both <classname>Error</classname>
and <classname>Exception</classname> implements the <classname>Throwable</classname> interface.
This handler function needs to accept one parameter,
which will be the <classname>Throwable</classname> object that was thrown.
Both <classname>Error</classname> and <classname>Exception</classname>
implement the <classname>Throwable</classname> interface.
This is the handler signature:
</para>
<para>
@ -66,7 +67,7 @@
<programlisting role="php">
<![CDATA[
<?php
function exception_handler($exception) {
function exception_handler(Throwable $exception) {
echo "Uncaught exception: " , $exception->getMessage(), "\n";
}