problem:
when you use construction
for a in _list_:
print a
it prints every item in array. But you can't alter array. Is it possible to alter value of array (something like a=123, but that ain't working)
I know it's possible (for example in while loop), but I want to do it this way (more elegant)
In PHP it would be like
foreach ($array as &$value) {
$value = 123;
}
(because of &
sign, is passed as reference)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…