OK looking into it further, it seems to be the custom error handler that doesn't use the @ error controller!
Heres my test code, the logic is:
1) create an array to loop
2) create statements for evaulation, that call a basic function.
3) Evaluate the statements.
First with the built in error handler, then with a custom error handler.
<?php
// Set report all errors
error_reporting(E_ALL);
// Create an array to test.
$test = array('ten', 'twenty', 'thirty', 'forty');
// Create an evaluate term.
$evalTerm = 'tester($test[$key], $test[$key-1]);';
// A function that tests the evaluate term.
function runTest($test, $evalTerm){
foreach ($test as $key => $value){
@eval($evalTerm);
}
}
// A function that outputs the variables.
function tester($arrayNow = NULL, $arrayBefore = NULL){
echo($arrayNow.' : '.$arrayBefore.'<br />');
}
// A Custom Error Handler (outputs the error message).
function ERROR_HANDLER($error_type, $error_msg, $error_file, $error_line, $error_context)
{
$a_ErrorTypes = array(E_ERROR =>'E_ERROR', // used to get a word-based error code
E_WARNING =>'E_WARNING', // instead of the number that will be
E_NOTICE =>'E_NOTICE', // passed to this function
E_USER_ERROR =>'E_USER_ERROR',
E_USER_WARNING =>'E_USER_WARNING',
E_USER_NOTICE =>'E_USER_NOTICE',
);
echo('<br />========== ERROR ==========<br /> ');
echo('<b>Type: </b>'.$a_ErrorTypes[$error_type].' :<b> Message:</b> '.$error_msg.' : <b> File:</b> '.$error_file.' : <b> Line:</b> '.$error_line.'<br />');
print_r($error_context);
echo('<br />======== ERROR END ======== <br />');
}
echo('<hr />');
// OK RUN THE TEST WITH THE NORMAL HANDLER:
echo(' ======= RUNNING NORMAL ERROR HANDLER ======== <br />');
runTest($test,$evalTerm);
echo('==================== DONE =====================');
echo('<hr />');
// NOW WITH A CUSTOM ERROR HANDLER:
set_error_handler('ERROR_HANDLER');
echo(' ======= RUNNING CUSTOM ERROR HANDLER ======== <br />');
runTest($test,$evalTerm);
echo('==================== DONE =====================');
echo('<hr />');
?>
My problem is I can't identfy in a custom error the @ control error prefix!