- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.6
- Parse error: syntax error, unexpected '$indexes' (T_VARIABLE) in /in/SkiIB on line 11
Process exited with code 255.
<?php
$x = new class() {
public $callCounters = [];
public function call($index) {
$callCounters[$index] ?? 0;
++$callCounters[$index];
}
}
$indexes = range('a','e');
foreach($indexes as $index) {
$r = rand(1,4);
for($i = 0; $i <= $r; ++$i) {
$x->call($index);
}
}
var_dump($x->callCounters);