1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00

object cannot covert to int/float in php, so change covert result to zero

This commit is contained in:
Xargin
2017-07-04 00:53:10 +08:00
parent d8dbf14af4
commit ac8dd56dfb
3 changed files with 14 additions and 42 deletions

View File

@ -30,6 +30,8 @@ var intConvertMap = map[string]int{
"-": 0,
"[]": 0,
"[1,2]": 1,
// object in php cannot convert to int
"{}": 0,
}
func Test_read_any_to_int(t *testing.T) {
@ -75,6 +77,7 @@ var uintConvertMap = map[string]int{
"-": 0,
"[]": 0,
"[1,2]": 1,
"{}": 0,
// TODO need to solve
//"-1.1": 1,
//"-321.1": 321,