I'm inspecting an open source web application. There's aproblem that it used error_get_last function as in this code
$last_error = error_get_last();
if($last_error['type'] === E_ERROR || $last_error['type'] === E_PARSE) {
include 'error.php';
}
if (ob_get_length()) ob_end_flush();
It annoys me because it seem that it cache old error of the old code however the edited code doesn't have any error. Therefore it display old error for a while. Does anyone know how to solve this problem? Thanks for any help
Edit: I show the function __shutdown() where the code run in the end of a request
function __shutdown() {
$logger_session = Logger::getSession();
if (($logger_session instanceof Logger_Session) && !$logger_session->isEmpty()) {
Logger::saveSession();
} // if
$last_error = error_get_last();
if($last_error['type'] === E_ERROR || $last_error['type'] === E_PARSE) {
include 'error.php';
}
if (ob_get_length()) ob_end_flush();
} // __shutdown