diff --git a/src/Node/SetNode.php b/src/Node/SetNode.php index 1d33cc775..4057c6a75 100644 --- a/src/Node/SetNode.php +++ b/src/Node/SetNode.php @@ -48,7 +48,7 @@ class SetNode extends Node implements NodeCaptureInterface $compiler->addDebugInfo($this); if (\count($this->getNode('names')) > 1) { - $compiler->write('list('); + $compiler->write('['); foreach ($this->getNode('names') as $idx => $node) { if ($idx) { $compiler->raw(', '); @@ -56,7 +56,7 @@ class SetNode extends Node implements NodeCaptureInterface $compiler->subcompile($node); } - $compiler->raw(')'); + $compiler->raw(']'); } else { $compiler->subcompile($this->getNode('names'), false); } diff --git a/tests/Node/SetTest.php b/tests/Node/SetTest.php index d3754cc29..c639be6a4 100644 --- a/tests/Node/SetTest.php +++ b/tests/Node/SetTest.php @@ -78,7 +78,7 @@ EOF $node = new SetNode(false, $names, $values, 1); $tests[] = [$node, <<getVariableGetter('bar')}]; +[\$context["foo"], \$context["bar"]] = ["foo", {$this->getVariableGetter('bar')}]; EOF ];