On Sat, 6 Jan 2024 at 18:02, Mönôme Epson <glash.gnome@xxxxxxxxx> wrote:
---------- Forwarded message ---------
For example :$key = "a";$value = 1;$array = [$key => $value];[$key => $value] = $array;
We all agree that now $key = 'a' and $value = 1And I wonder whyWhat happens in this case :[$key => $value] = ['b'=>2];$key = 'b' and $value = 2 or all is null ?
My question is: I see list() as the reciprocal of an array(). Do you think it would be interesting for everyone if I proposed my vision?
How will this help us?
In your example above, You want [ $key => $value ] to equal b and 2
Why not just say $key="b"; $value=2; ? Why the complex array or involve the array at all?
or just say $array["b"]=2; much simpler - if you wanted it in the array.
--
Gordon.