For loop variable being compiled incorrectly

The url variable inside the loop is being compiled to $this->url. I've only noticed it doing this when trying to use the variable name url.

<urlset>
    {% for url in urls %}
    <url>
        <loc>{{ url.loc }}</loc>
        <lastmod>{{ url.lastmod }}</lastmod>
        <changefreq>{{ url.changefreq }}</changefreq>
        <priority>{{ url.priority }}</priority>
    </url>
    {% endfor %}
</urlset>

Compiles to:

<urlset>
    <?php foreach ($urls as $url) { ?>
    <url>
        <loc><?php echo $this->url->loc; ?></loc>
        <lastmod><?php echo $this->url->lastmod; ?></lastmod>
        <changefreq><?php echo $this->url->changefreq; ?></changefreq>
        <priority><?php echo $this->url->priority; ?></priority>
    </url>
    <?php } ?>
</urlset>


85.4k

Variables are first checked if their name is a service registered in the application, in this case, "url" is the url resolver service, you will have the same behavior if you use: "di", "view", "router", "dispatcher", "flash", "session", "modelsManager", etc.

http://docs.phalconphp.com/en/latest/reference/volt.html#inject-services-into-a-template