- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.6
- Fatal error: Cannot use temporary expression in write context in /in/SJqK4 on line 7
Process exited with code 255.
<?php
class test {
public static $callCounters = [];
public function call($index) {
if (!isset(self::callCounters[$index])) {
self::callCounters[$index] = 0;
}
++self::callCounters[$index];
}
};
$x = new test();
$indexes = range('a','e');
foreach($indexes as $index) {
for($i = 0; $i <= 2; ++$i) {
$x->call($index);
}
}
var_dump(test::callCounters);