3 ms·
I would typically write: foreach ($arr as $key => &$val) $val = f($key, $val); This would avoid this issue, while bing simpler.
by megous 9y ago
I would typically write:
foreach ($arr as $key => &$val)
$val = f($key, $val);
This would avoid this issue, while bing simpler.