is there any equivalent to this PHP notation, which changes the original array (be aware of reference operator)?
// increase value of all items by 1
foreach ($array as $k => &$v) {
$v++;
}
I know only this way, which is not so elegant:
for i in range(len(array)):
array[i] += 1
You could use list comprehension: