- preg_match: documentation ( source)
- restore_error_handler: documentation ( source)
- set_error_handler: documentation ( source)
<?php
$error_handler = function() {
throw new Exception();
};
set_error_handler($error_handler, E_NOTICE | E_WARNING);
if (false === preg_match('```', null)) {
$error_handler();
}
restore_error_handler();