1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-30 04:19:30 +01:00

Ensure no registered error handler will see the 'reset' error

This commit is contained in:
Arne Blankerts 2014-01-22 00:48:27 +01:00 committed by nikic
parent bf9956b634
commit 6f36a88993

View File

@ -40,10 +40,14 @@ class PHPParser_Lexer
}
protected function resetErrors() {
// clear error_get_last() by forcing an undefined variable error
// set error_get_last() to defined state by forcing an undefined variable error
set_error_handler(array($this, 'dummyErrorHandler'), 0);
@$undefinedVariable;
restore_error_handler();
}
private function dummyErrorHandler() { return false; }
protected function handleErrors() {
$error = error_get_last();