mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +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() {
|
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();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user