I'm having a problem with eval(). Within the code that I'm eval()'ing there's an a call to exit(); which seems to be exiting out of the script that I'm calling eval() from.... Here's my code below:
function parse($code)
{
ob_start();
eval($code);
$executed = ob_get_contents();
ob_end_clean();
return $executed;
}
Basically what's happening is I'm calling this function from my main php script.. and at the end I'm outputting the results (along with the results of other functions) to the browser....
Problem is... this 'sub' program I'm calling is actually breaking my main php program... I've narrowed it down to the exit() calls in the eval'd code....
Is there a way to "containerize" the evaluation of the code so the results of the 'sub' program are included in the variable in my function above?.... I thought I was already doing that with the output buffering..... :-(