according to references i read, it seems that it is not possible to capture errors from eval function with set_error_handler.
even on php.net itself there were people talking about it :
http://readlist.com/lists/lists.php.net/php-general/5/29802.html
a simple example that shows that the custom error handler isn't called upon eval's error :
<?php
function errorHandler($errno, $errstr, $errfile, $errline) {
$errMessage = "<b>Error :</b> message '" . $errstr . "'".
" of file " . $errfile . " line " . $errline;
echo $errMessage;
//do something here
}
set_error_handler('errorHandler', E_ALL | E_PARSE | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR);
$toval = "getNameFunction();";
eval($toval);
?>
IS the only way to capture these errors done through manual checking? Like checking for eval that returns FALSE ?