diff --git a/reference/errorfunc/functions/set-error-handler.xml b/reference/errorfunc/functions/set-error-handler.xml index a76afc72ae..1539c9a897 100644 --- a/reference/errorfunc/functions/set-error-handler.xml +++ b/reference/errorfunc/functions/set-error-handler.xml @@ -1,5 +1,5 @@ - + @@ -13,6 +13,7 @@ stringset_error_handler callbackerror_handler + interror_types Sets a user function (error_handler) to handle @@ -23,6 +24,16 @@ or when you need to trigger an error under certain conditions (using trigger_error). + + The second parameter error_types was introduced in + PHP 5 and can be used to mask the triggering of the + error_handler function just like the error_reporting ini setting controls + which errors are shown. Without this mask set the + error_handler will be called for every error + unregardless to the setting of the error_reporting setting. + 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); ]]> - And when you run this sample script, the output will be : + And when you run this sample script, the output will be: error handler cannot be called since it is not registered at that time. + + + The second parameter error_types was introduced + in PHP 5. + + See also error_reporting, restore_error_handler,