Created
October 14, 2010 05:42
-
-
Save v6ak/625637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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