If you run the code below on go1.20 and 1.21 and above respectively, you can see that the results are different.
As you can see, even though it's a simple code that initialize map
and simply prints it, the result is always the same, and it varies between versions.
map_parsestr := gophplib.ParseStr("arr[]=A&arr[]=B&arr[9]=C&arr[]=D&arr[foo]=E&arr[]=F&arr[15.1]=G&arr[]=H")
fmt.Println(map_parsestr)
init_map := map[any]any{
"arr": map[any]any{
0: "A",
1: "B",
9: "C",
10: "D",
"foo": "E",
11: "F",
"15.1": "G",
12: "H",
},
}
fmt.Println(init_map)
The values always seem to stay constant once the 'map' is initialized, so presumably they are sorted by some condition, but unfortunately I didn't find anything about this in the release notes or official documentation.