$compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n");
// keep the values set in the inner context for variables defined in the outer context
- $compiler->write("\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));\n");
+ $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n");
}
}
}
\$_parent = \$context['_parent'];
unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']);
-\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));
+\$context = array_intersect_key(\$context, \$_parent) + \$_parent;
EOF
);
}
\$_parent = \$context['_parent'];
unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']);
-\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));
+\$context = array_intersect_key(\$context, \$_parent) + \$_parent;
EOF
);
}
\$_parent = \$context['_parent'];
unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']);
-\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));
+\$context = array_intersect_key(\$context, \$_parent) + \$_parent;
EOF
);
}
\$_parent = \$context['_parent'];
unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']);
-\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));
+\$context = array_intersect_key(\$context, \$_parent) + \$_parent;
EOF
);