Re: Add a new flag for json_encode
| From: | Jakub Zelenka | Date: | Wed, 05 Nov 2014 16:27:08 +0000 |
| Subject: | Re: Add a new flag for json_encode | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78728@lists.php.net to get a copy of this message | ||
On Wed, Nov 5, 2014 at 2:33 PM, Chris Wright <cw@daverandom.com> wrote:
>
> I'm afraid I have to disagree here, I don't like the idea of changing this
> behaviour without making it controllable, and your logic is also slightly
> flawed - it's not that you'd have to do an & ~ to disable, it's that it
> wouldn't be enabled unless you added it to your flags argument. Passing a
> value of JSON_FORCE_OBJECT wouldn't be handled as JSON_FORCE_OBJECT |
> JSON_PRESERVE_FRACTIONAL_PART, you'd just need to explicitly pass 0 to the
> flags argument to disable it.
>
That was just only possible use case for JSON_PRESERVE_FRACTIONAL_PART if
it was made default in the PHP 7 but when I think about it's a bit stupid.
It could theoretically work if all constants were ORed with that value but
that's nonsens.
Jakub