- set_error_handler: documentation ( source)
<?php
function handleError( $errno, $errstr, $errfile, $errline ) {
if ( E_RECOVERABLE_ERROR === $errno ) {
echo "<h2 class='error'>" . $errstr . "\n";
}
}
set_error_handler( 'handleError' );
$g = new Generator;
$g->whatami = "a highly dubious property";
echo "\n\nThe code rocks on ... \n\n";