diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php index aa5a278a..dd651321 100644 --- a/src/Monolog/ErrorHandler.php +++ b/src/Monolog/ErrorHandler.php @@ -81,12 +81,7 @@ class ErrorHandler public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1) { $prev = set_error_handler(array($this, 'handleError'), $errorTypes); - $this->errorLevelMap = $this->defaultErrorLevelMap(); - // merging the map into the defaults by hand because array_merge - // trips up on numeric keys - foreach ($levelMap as $key => $val) { - $this->errorLevelMap[$key] = $val; - } + $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap); if ($callPrevious) { $this->previousErrorHandler = $prev ?: true; }