bobthecow/mustache.php — Issue #78: Array rendering
Author: jwronsky
Created: 2012-02-07 10:52:30+00:00
State: open

I think there is a bug in Mustache.php code at line:

```php
while ($next = array_shift($chunks)) {
```

When parsing array like "array('foo', 'bar');" to the template like: "{{array.0}} {{array.1}}", the output is: "Array, 'bar'", because ($next = array_shift($chunks)) at key '0 evaluates to false and full array is returned.

My proposed solution is:

```php
while (count($chunks)) {
// Slice off a chunk of context for dot notation traversal.
$next = array_shift($chunks);
```