Im executing the list of php codes via eval, If there is any error in code i want to display this code have fatal error/parse error.
is there any way to give custom message for fatal error or any other error
My code is like this :
$output = []; foreach($codes as $key => $res) { if(eval($res['code'])) { eval($res['code']); $output[$key] = $result; } else { $output[$key] = "Fatal error in code"; } } var_dump($output);