Skip to content

Instantly share code, notes, and snippets.

@v6ak
Created October 14, 2010 05:42
Show Gist options
  • Save v6ak/625637 to your computer and use it in GitHub Desktop.
Save v6ak/625637 to your computer and use it in GitHub Desktop.
<?php
echo 'runkit.internal_override:', ini_get('runkit.internal_override'), "\n";
//ini_set('runkit.internal_override', true); // Does not work, because it is PHP_INI_SYSTEM
runkit_function_rename('register_shutdown_function', 'v6ak_internal_register_shutdown_function'); // You have to enable runkit!
if(true){ // It reports redeclaration of function without whis.
function register_shutdown_function($func){
$args = func_get_args();
array_shift($args);
v6ak_internal_register_shutdown_function(function() use($args){
try{
call_user_func_array($func, $args);
}catch(Exception $e){
print_r($e);
}
});
};
};
register_shutdown_function(function(){
throw new Exception();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment