Skip to content

Variable access to array index #55

@clphillips

Description

@clphillips

Assume the following:

$arr = array(
    array('x' => 0),
    array('x' => 1),
    array('x' => 2),
    array('x' => 3),
);

$b = array(1, 2, 3, 4);
{% for a in arr %}
    {{ b.{{ a.x }} }}

{% endfor %}

Expected output:

1
2
3
4

Actual output: unexpected character in filters : "." at 306 on line 228 in /h2o/h2o/parser.php

(edited to clarify variable tags)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions