diff --git a/ErrorHandler.php b/ErrorHandler.php index c98eea8..0c8edfc 100644 --- a/ErrorHandler.php +++ b/ErrorHandler.php @@ -519,7 +519,7 @@ public function handleError(int $type, string $message, string $file, int $line) if ($this->isRecursive) { $log = 0; } else { - if (!\defined('HHVM_VERSION')) { + if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404)) { $currentErrorHandler = set_error_handler('var_dump'); restore_error_handler(); } @@ -531,7 +531,7 @@ public function handleError(int $type, string $message, string $file, int $line) } finally { $this->isRecursive = false; - if (!\defined('HHVM_VERSION')) { + if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404)) { set_error_handler($currentErrorHandler); } } diff --git a/Tests/ErrorHandlerTest.php b/Tests/ErrorHandlerTest.php index 7071030..28b3115 100644 --- a/Tests/ErrorHandlerTest.php +++ b/Tests/ErrorHandlerTest.php @@ -363,8 +363,6 @@ public function testHandleDeprecation() $handler = new ErrorHandler(); $handler->setDefaultLogger($logger); @$handler->handleError(E_USER_DEPRECATED, 'Foo deprecation', __FILE__, __LINE__, []); - - restore_error_handler(); } /** @@ -618,6 +616,10 @@ public function errorHandlerWhenLoggingProvider(): iterable public function testAssertQuietEval() { + if ('-1' === ini_get('zend.assertions')) { + $this->markTestSkipped('zend.assertions is forcibly disabled'); + } + $ini = [ ini_set('zend.assertions', 1), ini_set('assert.active', 1),