From aa72af7d7d5f48db6e16820f9827c26a9557e6c6 Mon Sep 17 00:00:00 2001 From: Ludovic Montel Date: Thu, 9 Jul 2020 10:26:43 +0200 Subject: [PATCH] Make nested ternary operators priority explicit The left-associativity of the ternary operator has been deprecated in PHP 7.4 Fixes #106 --- Bin/Pp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bin/Pp.php b/Bin/Pp.php index 9e6a5954..19b45ff8 100644 --- a/Bin/Pp.php +++ b/Bin/Pp.php @@ -231,10 +231,10 @@ protected function printTokenSequence(Compiler\Llk\Parser $compiler, $data) $token['token'], 30 < $token['length'] ? mb_substr($token['value'], 0, 29) . '…' - : 'EOF' === $token['token'] + : ('EOF' === $token['token'] ? str_repeat(' ', 30) : $token['value'] . - str_repeat(' ', 30 - $token['length']), + str_repeat(' ', 30 - $token['length'])), $token['offset'] ); }