wkx_error_handler()
Custom PHP errors handler
wkx_error_handler(int $errno, string $errstr, string $errfile, int $errline) : bool
cf. https://www.php.net/manual/fr/function.set-error-handler.php
The $errcontext parameter is not used because it is deprecated since PHP 7.2
It is no longer possible to know the context of the error. Instead
we use the debug_print_backtrace() function.
NB: fatal errors like ‘parse error’ are still written in the log
defined by error_log php.ini option because this handler cannot be called in that case.
Parameters
-
$errno
: int
-
-
$errstr
: string
-
-
$errfile
: string
-
File or script where the error occurred
-
$errline
: int
-
wkx_error_function_args()
Prints in tabular format the positional arguments of a function to the logs
wkx_error_function_args(string $func_name, string $func_args) : void
To use this function, add at the top of the traced function body:
wkx_error_function_args(FUNCTION, func_get_args());
or
wkx_error_function_args(METHOD, func_get_args());
Parameters
-
$func_name
: string
-
Function name (e.g. pass FUNCTION)
-
$func_args
: string
-
Function arguments (e.g. pass func_get_args())