gophp icon indicating copy to clipboard operation
gophp copied to clipboard

slice order changes

Open booksmaster opened this issue 11 months ago • 2 comments

Hi guys. You have a mistake in your code that messes up the order of elements inside the slice. I'm sorry I didn't save your original code but to fix it you need to change the code in file unserialize.go starting from line 208 to this code:

if indexLen == arrLen {
		var slice []interface{}
		for i := 0; i < arrLen; i++ {
			n, _ := utils.NumericalToString(i)
			slice = append(slice, val[n])
		}
		return slice, nil

	}

Have a nice day and thanks for your work! It's awesome besides this issue

booksmaster avatar Aug 02 '23 14:08 booksmaster

@booksmaster Hi, Can you update to the latest version and try ?

leeqvip avatar Aug 15 '23 02:08 leeqvip

It has been fixed https://github.com/leeqvip/gophp/pull/14

leeqvip avatar Aug 15 '23 02:08 leeqvip