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() { 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; @$undefinedVariable;
restore_error_handler();
} }
private function dummyErrorHandler() { return false; }
protected function handleErrors() { protected function handleErrors() {
$error = error_get_last(); $error = error_get_last();