Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save r37r0m0d3l/5734640 to your computer and use it in GitHub Desktop.
Save r37r0m0d3l/5734640 to your computer and use it in GitHub Desktop.
<?php
set_error_handler(function(){ echo "INTERNAL\n"; });
function chain_error_handler($new_handler){
$old_handler = set_error_handler(function() use (&$old_handler,$new_handler){
call_user_func_array($new_handler,func_get_args());
call_user_func_array($old_handler,func_get_args());
});
}
chain_error_handler(function(){ echo ":D\n"; });
$a = 1/0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment