array(2) {
["foo"]=>
float(3)
["bar"]=>
float(3.1)
}
string(19) "{"foo":3,"bar":3.1}"
{"foo":3.0,"bar":3.1}
Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /in/DCb3f:8
Stack trace:
#0 {main}
thrown in /in/DCb3f on line 8
Process exited with code 255.
array(2) {
["foo"]=>
float(3)
["bar"]=>
float(3.1)
}
string(19) "{"foo":3,"bar":3.1}"
{"foo":3.0,"bar":3.1}
Recoverable fatal error: Object of class stdClass could not be converted to string in /in/DCb3f on line 8
Process exited with code 255.
Output for 5.6.6 - 5.6.28, 7.0.0 - 7.0.20
array(2) {
["foo"]=>
float(3)
["bar"]=>
float(3.1)
}
string(19) "{"foo":3,"bar":3.1}"
{"foo":3.0,"bar":3.1}
Catchable fatal error: Object of class stdClass could not be converted to string in /in/DCb3f on line 8
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.5
array(2) {
["foo"]=>
float(3)
["bar"]=>
float(3.1)
}
string(19) "{"foo":3,"bar":3.1}"
Notice: Use of undefined constant JSON_PRESERVE_ZERO_FRACTION - assumed 'JSON_PRESERVE_ZERO_FRACTION' in /in/DCb3f on line 7
Warning: json_encode() expects parameter 2 to be long, string given in /in/DCb3f on line 7
Catchable fatal error: Object of class stdClass could not be converted to string in /in/DCb3f on line 8
Process exited with code 255.