i added the type casting so that the generated token becomes 
```php
<?php echo $foo[0]; ?>
```

instead of ```<?php echo $foo['0']; ?>```... but this is just for precision,.. of cause it also works with `$foo['0']`, so this could be dropped and `ctype_digit` used instead of the `is_int` below.