InlinePrint example

return $expr2Safe !== $expr3Safe;
    }

    private function unwrapConditional(ConditionalExpression $expression, Environment $env, string $type): ConditionalExpression
    {
        // convert "echo a ? b : c" to "a ? echo b : echo c" recursively         $expr2 = $expression->getNode('expr2');
        if ($expr2 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr2$env$type)) {
            $expr2 = $this->unwrapConditional($expr2$env$type);
        } else {
            $expr2 = $this->escapeInlinePrintNode(new InlinePrint($expr2$expr2->getTemplateLine())$env$type);
        }
        $expr3 = $expression->getNode('expr3');
        if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr3$env$type)) {
            $expr3 = $this->unwrapConditional($expr3$env$type);
        } else {
            $expr3 = $this->escapeInlinePrintNode(new InlinePrint($expr3$expr3->getTemplateLine())$env$type);
        }

        return new ConditionalExpression($expression->getNode('expr1')$expr2$expr3$expression->getTemplateLine());
    }

    
Home | Imprint | This part of the site doesn't use cookies.