Hi Guys It was state that JSON scheme will take some time to be implement and probably wouldn't be able for 5.6. IMHO JSON_FLOAT_AS_STRING probably it isn't the idle fix (the idle solution would be to not even have a bug/error like this), so the question would be, do we want developers decoding json with precision loss until JSON scheme eventually comes or give them the ability to decide for them self on how to proceed.
+1 Pasindu On Wed, Jun 10, 2015 at 7:09 PM, Jakub Zelenka <bu...@php.net> wrote: > Hi Yasuo, > > On Wed, Jun 10, 2015 at 11:57 AM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote: > > > Hi Derick, > > > > On Wed, Jun 10, 2015 at 7:28 PM, Derick Rethans <der...@php.net> wrote: > > > >> > Hi, > >> > > >> > The voting is now open: > >> > > >> > https://wiki.php.net/rfc/json_numeric_as_string#voting > >> > >> FWIW, I voted no to all of them because (as you even say in the RFC), > >> this is probably better be solved with a JSON schema thingy. > > > > > > JSON Schema does not help to decoding/encoding numeric data without > > loosing data. > > > > JSON Schema Core > > http://json-schema.org/latest/json-schema-core.html#anchor8 > > Note: JSON specification does not specify precision. So number could be > > any number. > > > > JSON Schema Validation > > http://json-schema.org/latest/json-schema-validation.html#anchor5 > > > > Those who do not care rounding errors/etc, they can use default behavior. > > > > > The idea would be to use JSON schema just for selecting the type for > deserialized item in decoded JSON. It means that you could for example > select one float item that you want to decode as a string but other floats > would be still decoded as floats. That gives a better flexibility and helps > the problem in the same way. Please see my email to Alexey when we > discussed this RFC (there are few examples): > > https://www.mail-archive.com/internals@lists.php.net/msg78698.html > > Cheers > > Jakub > -- *Pasindu De Silva**ppasin...@gmail.com <ppasin...@gmail.com>*