Voting

: min(three, zero)?
(Example: nine)

The Note You're Voting On

TiMESPLiNTER
10 years ago
Works also for restoring nested error handlers:

<?php

error_reporting
(E_ALL);

echo
'<pre>';

set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
echo
'ErrorHandler 1: ' , $errstr , PHP_EOL;
});

trigger_error('Error 1');

set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
echo
'ErrorHandler 2: ' , $errstr , PHP_EOL;
});

trigger_error('Error 2');

restore_error_handler();

trigger_error('Error 3');

restore_error_handler();

trigger_error('Error 4');

?>

<< Back to user notes page

To Top