Description:
" In case of a parse error in the evaluated code, eval() returns FALSE.
In case of a fatal error in the evaluated code, the whole script exits."
Reproduce code:
$page = 'for(\$i=0;\$i<=2;\$i++){?>';
$page .= '<b>test code</b>';
$page .= '<? } ?>';
$cad = $page;
$cad = @eval($cad)==false ? echo $cad : ob_get_contents();
Expected result:
$cad should be $cad='<b>test code</b><b>test code</b><b>test code</b>'
Actual result:
$cad is echod to the screen
and don't tell me not to use echo, because i want to output something if the eval() fails.
Why doesn't this work?