You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Big integers should be returned as string (~JSON_BIGINT_AS_STRING) #9
What to do with numbers such as 0x123456789123456781345678913? I would prefer to return them as decimal string however I'm not aware of any efficient solution to perform the conversion.
What about E_USER_WARNING on big number? To force user enclose it in quotes as a string. JSON has the JSON_BIGINT_AS_STRING only for interoperability between 32-bit and 64-bit systems.
What to do with numbers such as 0x123456789123456781345678913? I would prefer to return them as decimal string however I'm not aware of any efficient solution to perform the conversion.
The only sane way I know in PHP is the GMP extension.
What about E_USER_WARNING on big number? To force user enclose it in quotes as a string.
Please, don't. JSON NEON is not something you always manually construct in the application, it's rather given from elsewhere, really not something you control directly (thus should not trigger an error).
There is no sane way how to handle big numbers or have you forgotten about very large decimals?
It should be string representation of given number or native PHP representation if possible. This is the simple solution
We can add custom number parser into mix as a fallback or parameter with default set to sane parser. Quite easy, hard problem of what to do with numbers will be solved by user.
In my magic ball I see this heading to custom number parser with default implementation that handles numbers of all colours and sizes.
Activity
Majkl578 commentedon Apr 9, 2014
Some cute regexp?
JanTvrdik commentedon Apr 9, 2014
This is what I have now – JanTvrdik@c302826
JanTvrdik commentedon Apr 9, 2014
What to do with numbers such as
0x123456789123456781345678913? I would prefer to return them as decimal string however I'm not aware of any efficient solution to perform the conversion.milo commentedon Apr 9, 2014
What about E_USER_WARNING on big number? To force user enclose it in quotes as a string. JSON has the JSON_BIGINT_AS_STRING only for interoperability between 32-bit and 64-bit systems.
milo commentedon Apr 9, 2014
The only sane way I know in PHP is the GMP extension.
Majkl578 commentedon Apr 9, 2014
Please, don't.
JSONNEON is not something you always manually construct in the application, it's rather given from elsewhere, really not something you control directly (thus should not trigger an error).JanTvrdik commentedon Apr 9, 2014
But still agreed, warning is the solution I would like to avoid.
mishak87 commentedon Apr 10, 2014
There is no sane way how to handle big numbers or have you forgotten about very large decimals?
It should be string representation of given number or native PHP representation if possible. This is the simple solution
We can add custom number parser into mix as a fallback or parameter with default set to sane parser. Quite easy, hard problem of what to do with numbers will be solved by user.
In my magic ball I see this heading to custom number parser with default implementation that handles numbers of all colours and sizes.
Decoder: big integers are decoded as strings [Closes #9]
Decoder: big integers are decoded as strings [Closes #9]
Decoder: big integers are decoded as strings [Closes #9]