I also prefer to use ​different flags if we enable by default. So if this
behavior is enabled by default in 7.0 the JSON_PRESERVE_FRACTIONAL_PART is
deprecated and a new flag is created to disable it.

In resume of this thread, seems everyone if fine in having the flag
JSON_PRESERVE_FRACTIONAL_PART
added on 5.6 and leave this flag off by default to keep the BC. The only
discussion is enable or not this behavior in 7.0.

Andrea, I see your concerns about the bigint changes, but I am not sure if
they are related. The PR just affect the encoding, not the decoding part.
So if some Python system encodes a JSON using the decimal part it will be
the same of PHP encoding using this new flag. So, if you think the decode
can cause an issue on bigint, it needs a big concern for system
interoperability on this part. Also, what I am proposing is not to change
all integers in floats. What I am proposing with this flag is to make
floats values (PHP zval) output as float in the JSON. It doesn't affect
anything in the PHP variables.


Juan Basso

Reply via email to