- set_error_handler: documentation ( source)
- trigger_error: documentation ( source)
<?php
trigger_error('this is no problem - just a notice');
set_error_handler(function ($s, $m, $f, $l) {
throw new ErrorException($m, 0, $s, $f, $l);
});
echo "this will still work fine:"; @trigger_error('see? no problem');
echo "\nthis, however, will not:"; trigger_error('see? no problem');