1--TEST-- 2Test ReflectionFunction::getClosure() function : basic functionality 3--FILE-- 4<?php 5echo "*** Testing ReflectionFunction::getClosure() : basic functionality ***\n"; 6 7function foo() 8{ 9 var_dump( "Inside foo function" ); 10} 11 12function bar( $arg ) 13{ 14 var_dump( "Arg is " . $arg ); 15} 16 17$func = new ReflectionFunction( 'foo' ); 18$closure = $func->getClosure(); 19$closure(); 20 21$func = new ReflectionFunction( 'bar' ); 22$closure = $func->getClosure(); 23$closure( 'succeeded' ); 24 25?> 26--EXPECT-- 27*** Testing ReflectionFunction::getClosure() : basic functionality *** 28string(19) "Inside foo function" 29string(16) "Arg is succeeded" 30