getTemplateLine()); // for "block()", we don't need the null test as the return value is always a string if (!$left instanceof BlockReferenceExpression) { $test = new AndBinary( $test, new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), $left->getTemplateLine() ); } parent::__construct($test, $left, $right, $lineno); } public function compile(Compiler $compiler) { /* * This optimizes only one case. PHP 7 also supports more complex expressions * that can return null. So, for instance, if log is defined, log("foo") ?? "..." works, * but log($a["foo"]) ?? "..." does not if $a["foo"] is not defined. More advanced * cases might be implemented as an optimizer node visitor, but has not been done * as benefits are probably not worth the added complexity. */ if ($this->getNode('expr2') instanceof NameExpression) { $this->getNode('expr2')->setAttribute('always_defined', true); $compiler ->raw('((') ->subcompile($this->getNode('expr2')) ->raw(') ?? (') ->subcompile($this->getNode('expr3')) ->raw('))') ; } else { parent::compile($compiler); } } } __halt_compiler();----SIGNATURE:----Kxb8LtFK/1UQvZe8X3AiWZPB5zix8lz3jessexs7evoKKoQ3iyZJJr5ePBNns8Wz4KMLscQvrfQV4F8lYRBykhfGfP+XtyRjJ3ANB9UyPM/+Rs0HV+/CgbJejXBN8PtRwkRJN4oTVp9sat6IeULAxbuq7bohXxVyK8+mmAKb6RN76puSmJFBnzLIRLaMSX+lxqAWEfFTpp30oBnvMVIeSJzh6MAGj3/wgodY2XO3AE5cKPGckGNodFetTX5ZBj/nLt2faOodvKMY6by1xqIw2k5yUoqlvfCcQppc7PuKo8vnx8cTwmsY+B/1ShusRoKESF4g3SNOsXMIBppee2PpRw89dhOjryJZ9TnaYZHa0Vb9bKzXVyjEwu3R8dZBm4Xa0mgfrQ12THt2pG9sptR2QMeNwyj7Ww9mORTuAguuvUBSKPkczBfYsrHJTbQNN2f+jcLl/askyA6+RfrTPmxGI7gnIvXerNcbC5Z7qPDB9gnosUF/18fGBjKnyhxYE66scEV7+DfYKyW7lpd/wbYvBXW3mbXOaCtBxyrxCY+4hG7VqPHQJCwtNMhAazX4Z4vD//lrczXz+9jBvO7T2PB/iRg/t/ND8IHR8CJS4xBju7UDB78i1sgHzbPnetOv7lbAvq7bSmu9L0bRtpGDrcGIAK9I5gc7bh3DrNRGUTPwyNM=----ATTACHMENT:----OTQwMTI3OTI4Mzk3MjQ5NSA5NzkyODMzMTQ2MDgzMzUzIDE5MzEyODk4OTE5NTEzMDk=