Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 74f4b772aa
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (31 sloc) 0.882 kb
Runkit_Sandbox Nesting
<?php if(!extension_loaded("runkit")) print "skip";
/* May not be available due to lack of TSRM interpreter support */
if(!function_exists("runkit_lint")) print "skip"; ?>
$php = new Runkit_Sandbox();
$php['output_handler'] = 'child_output';
$php->eval('echo "Foo\n";
$grandchild = new Runkit_Sandbox();
$grandchild["output_handler"] = "grandchild_output";
$grandchild->eval(\'echo "Bar\n";\');
echo "Baz\n";
function grandchild_output($str) {
if (strlen($str) == 0) return NULL; /* flush() */
return "Grandchild Says: $str";
echo "Bling\n";
function child_output($str) {
if (strlen($str) == 0) return NULL; /* flush() */
return "Child Says: $str";
Child Says: Foo
Child Says: Grandchild Says: Bar
Child Says: Baz
Child Says: Blong
Jump to Line
Something went wrong with that request. Please try again.