src/Parser/Parser.php
protected function parseTernary(Node $left, array $ternary): Node
    {
        foreach ($ternary as list (, $truePart, , $falsePart)) {
            if ($truePart === null) {
                $left = new TernaryOperator($left, $falsePart);
            } else {
                $left = new TernaryOperator($left, $truePart, $falsePart);
            }
        }
        
        return $left;
    }
protected function parseTernary(Node $left, array $ternary): Node
    {
        foreach ($ternary as list (, $truePart, , $falsePart)) {
            if ($truePart === null) {
                $left = new TernaryOperator($left, $falsePart);
            } else {
                $left = new TernaryOperator($left, $truePart, $falsePart);
            }
        }
        
        return $left;
    }
Ternary ::= Disjunction ( '?' Disjunction? ':' Disjunction )*