diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 28fea7aac9..efd1710292 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -111,7 +111,7 @@ class DeprecationErrorHandler exit(1); } - if ('legacy' !== $group && self::MODE_WEAK !== $mode) { + if ('legacy' !== $group && DeprecationErrorHandler::MODE_WEAK !== $mode) { $ref = &$deprecations[$group][$msg]['count']; ++$ref; $ref = &$deprecations[$group][$msg][$class.'::'.$method]; @@ -131,7 +131,7 @@ class DeprecationErrorHandler restore_error_handler(); self::register($mode); } - } elseif (!isset($mode[0]) || '/' !== $mode[0]) { + } else { self::$isRegistered = true; if (self::hasColorSupport()) { $colorize = function ($str, $red) { @@ -144,6 +144,9 @@ class DeprecationErrorHandler } register_shutdown_function(function () use ($getMode, &$deprecations, $deprecationHandler, $colorize) { $mode = $getMode(); + if (isset($mode[0]) && '/' === $mode[0]) { + return; + } $currErrorHandler = set_error_handler('var_dump'); restore_error_handler();