function shutdownHandler() { P::mark('END'); P::report(); if ($aError = error_get_last()) { errorHandler($aError['type'], $aError['message'], $aError['file'], $aError['line']); } // Flush debug $oPhpLogFile = fopen($_ENV['SETTINGS']['FILE_LOG_PHP'], 'a'); fwrite($oPhpLogFile, $_ENV['DEBUG']); fclose($oPhpLogFile); }