When iterating on the context, one of the iterated element is the parent context, identifier by the _parent key. TwigFiddle being down, here is a quick Twig sample:
{% for key, value in _context %}
{{ key }}
{% endfor %}
The output of this template, with an empty context, is:
_parent
Is it something that is contractual per TwigPHP specification? If not, why is it there, and why do developers have to know that it exists in order to not take it into account, like in the mentioned issue?
This is related to https://github.com/twigphp/Twig/issues/1584.
When iterating on the context, one of the iterated element is the parent context, identifier by the
_parent
key. TwigFiddle being down, here is a quick Twig sample:The output of this template, with an empty context, is:
Is it something that is contractual per TwigPHP specification? If not, why is it there, and why do developers have to know that it exists in order to not take it into account, like in the mentioned issue?