diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 2c7d3de736..d4ad03a02f 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -126,9 +126,11 @@ class Application } if ($this->autoExit) { - // ensure exit code is between 0-254 (255 is reserved by PHP and should not be used) + if ($statusCode > 255) { + $statusCode = 255; + } // @codeCoverageIgnoreStart - exit(max(0, min(254, $statusCode))); + exit($statusCode); // @codeCoverageIgnoreEnd }