bobthecow/mustache.php — pull request #219 by nizsheanez (2014-08-15 10:24:45+00:00)
Title: sequential array checking speedup

This variant almost 2 times faster
Test:

```
for ($j = 1; $j < 7; $j++) {
$value = range(0, pow(10, $j));
$a = -microtime(true);
//is sequential array - not associative
array_keys($value) === range(0, count($value) - 1);
$a += microtime(true);
echo $a;
echo " ";
$a = -microtime(true);
$i = 0;
foreach ($value as $k => $v) {
if ($k !== $i++) {
return false;
}
}
$a += microtime(true);
echo $a;
echo "\n";
}
```

Result:

1.0013580322266E-5 5.9604644775391E-6
3.504753112793E-5 3.2901763916016E-5
0.0005040168762207 0.00033116340637207
0.0060639381408691 0.0033388137817383
0.070620775222778 0.026356935501099
0.62192797660828 0.29023885726929