Skip to content

Commit 6e57380

Browse files
committed
[Console] Fixed the rendering of exceptions on HHVM with a terminal width
1 parent 555fde5 commit 6e57380

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Component/Console/Application.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,11 @@ public function renderException($e, $output)
728728
do {
729729
$title = sprintf(' [%s] ', get_class($e));
730730
$len = $strlen($title);
731+
$width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX;
731732
// HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
732-
$width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : (defined('HHVM_VERSION') ? 1 << 31 : PHP_INT_MAX);
733+
if (defined('HHVM_VERSION') && $width > 1 << 31) {
734+
$width = 1 << 31;
735+
}
733736
$formatter = $output->getFormatter();
734737
$lines = array();
735738
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {

0 commit comments

Comments
 (0)