On Wed, Nov 5, 2014 at 5:34 PM, Jakub Zelenka <bu...@php.net> wrote: > > > On Wed, Nov 5, 2014 at 4:23 PM, Juan Basso <jrba...@gmail.com> wrote: > >> >> 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. >> > > No! If it should become default in 7.0, then it doesn't make to add a new > flag. What's the point of adding new flag to 5.6.x and then deprecate it in > 7.0...? That's just mess IMHO. > > It makes sense only if it doesn't become default though. > > Cheers > > Jakub > > I think we should postpone the decision about changing the default value, and keep the scope about having JSON_PRESERVE_FRACTIONAL_PART as an optional setting. As far as I can see, everybody seems to be okay with that. I don't think that the possibility of changing the default settings in a future release(eg. 7.0) change anything about this option: The $options for json_encode is already a bitmask, and even if we change the default, you will still need the constant to be able to disable this behavior if you don't need it. I don't think that anybody else from the list favors this option in such depths that he/she would agree with you that we should even remove the option to opt-out from JSON_PRESERVE_FRACTIONAL_PART, for two reason: 1, for most apps/systems doesn't care if they receive 1.0 or 1, but sending out 1 instead of 1.0 makes the encoded form shorter so maybe some people would prefer to keep that more compact. 2, there is a chance that there are some exotic apps/systems which are already depending on the fact that php will/was used to send out 1 instead of 1.0, and while we can break BC in a major release, the migration for those people would be much easier if they just have to change/set some options for their json_encode calls.
-- Ferenc Kovács @Tyr43l - http://tyrael.hu