1

PHPで次のことを試すと:

var_dump(json_decode("123"));

var_dump(json_decode("true"));

私が期待するのは:

NULL

NULL

しかし、私が実際に得るものは次のとおりです。

int(123)

bool(true)

"123" と "true" は有効な JSON 文字列と見なされますか? それとも json_decode() の実装のバグですか?

ありがとう。

4

3 に答える 3