Skip to content
This repository
tree: 74f4b772aa
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 26 lines (25 sloc) 0.653 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
--TEST--
runkit_function_redefine() and revert
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip"; ?>
--INI--
error_reporting=E_ALL
display_errors=on
runkit.internal_override=On
--FILE--
<?php
//xdebug_start_code_coverage();
echo sprintf("%s\n",'bar');
runkit_function_copy('sprintf','sprintf_old');
runkit_function_redefine('sprintf','$a,$b', 'return "new function\n" . sprintf_old($a,$b);');
echo sprintf("%s\n",'bar');
runkit_function_remove('sprintf');
runkit_function_copy('sprintf_old','sprintf');
runkit_function_remove('sprintf_old');
echo sprintf("%s\n",'foo');
?>
--EXPECT--
bar
new function
bar
foo
Something went wrong with that request. Please try again.