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:
parent
bf9956b634
commit
6f36a88993
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user