On 5 November 2014 17:21, Jakub Zelenka <bu...@php.net> wrote: > > > On Wed, Nov 5, 2014 at 4:52 PM, Chris Wright <c...@daverandom.com> wrote: > >> >> I'm sorry, but I don't understand why it would need to be deprecated. For >> me "making it the default behaviour" would mean "changing the default value >> of the $flags argument to JSON_PRESERVE_FACTIONAL_PART". The flag would >> still function in exactly the same way - old code which pass flags >> explicitly would continue to work in the same way, and any code which did >> not want the new behaviour would only have to pass 0 to flags to get that >> behaviour back. >> >> > > Then passing any flag will automatically disable it unless all current > constants will be ORed with that value. > > It means if you set default as (options = JSON_PRESERVE_FACTIONAL_PART in > zif_json_encode) and you pass just PHP_JSON_UNESCAPED_UNICODE then > fractional part will be disabled (unless the constants are ORed). It's not > really default like other defaults in json_encode because it's changed by > any flag. > > Indeed, but this is how anything else in PHP with a $flags argument works... if I pass ENT_QUOTES to htmlspecialchars() it isn't handled as ENT_COMPAT | ENT_HTML401 | ENT_QUOTES.
When you pass a $flags argument to a function explicitly, you are saying "I don't want the default behaviour, I want more control", so I would be a little surprised if my controlled options were suddenly changed and now I have to add another flag to get the behaviour I wanted (and had before the default value was changed). Of course, this is just my view :-) Thanks, Chris > That being said if it's just me who doesn't like it and there are no other > objection, I don't mind if it gets in. Let's just wait few days if there > isn't anyone who also thinks that adding such feature to micro release is > not the best idea... > > Cheers > > Jakub >