ID: 22278
Updated by: [EMAIL PROTECTED]
Reported By: mazanek at abeo dot cz
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: windows
PHP Version: 4.2.3
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.
Thank you for your interest in PHP.
bug #15663
Previous Comments:
------------------------------------------------------------------------
[2003-02-18 11:37:59] mazanek at abeo dot cz
this is old issue #3074 - do you support foreach by reference?
I'm using PHP Version 4.2.2.
Having multidimensional array - $multi_array.
I would like to change the $multi_array from place marked **HERE**
foreach($multi_array AS $multi_key=>$multi_array_item)
{ foreach($multi_array_item["another_array"] AS $key=>$value)
{ if($value=="asdfg")
{ **HERE**
}
...
}
}
I have to do it using:
$multi_array[$multi_key]["another_array"][$key]=$new_value
- - - - - - - -
It would be nice to use "&" to change the $multi_array:
foreach($multi_array AS $multi_key=>&$multi_array_item)
{ foreach($multi_array_item["another_array"] AS &$value)
{ if($value=="asdfg")
{ $value=$new_value;
$multi_array_item["value_have_changed"]=true;
}else
{ $multi_array_item["value_have_changed"]=false;
}
...
}
}
Is it possible to implement this to new version of PHP?
Thanks,
Jan Maz�nek
[EMAIL PROTECTED]
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22278&edit=1