Skip to content

Instantly share code, notes, and snippets.



Last active Jan 20, 2019
What would you like to do?
PHP: copy_function()
function copy_function($name) {
$reflection = new ReflectionFunction($name);
return function(...$arguments) use($reflection) {
return call_user_func_array([$reflection, 'invoke'], $arguments);
$fn = copy_function('is_int');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.