- set_exception_handler: documentation ( source)
- set_error_handler: documentation ( source)
<?php
set_error_handler(function($errorLevel, $errorMessage) {
echo 'in set_error_handler' . PHP_EOL;
echo 'errorLevel is ' . ($errorLevel == E_RECOVERABLE_ERROR ? '': 'NOT') . 'E_RECOVERABLE_ERROR' . PHP_EOL;
echo $errorMessage . PHP_EOL;
});
set_exception_handler(function($exception) {
echo 'in set_exception_handler' . PHP_EOL;
echo 'Exception is ' . get_class($exception) . PHP_EOL;
echo $exception->getMessage() . PHP_EOL;
});
function a(array $a){}
a(null);