> On 4 Nov 2014, at 20:06, Jakub Zelenka <bu...@php.net> wrote:
> 
> That's a good point. However I still think that there are more advantages for 
> making this the default. I like mainly the idea that 
> json_decode(json_encode($a)) = $a for all floats which is not the case at the 
> moment. Also it allow some other things that were mentioned before.

It won’t be with or without your changes, as JSON can’t encode Infinity or NaN.

Also, I don’t think it matters. PHP isn’t a strictly-typed language where 
there’s an important difference between float(7000) and int(7000). They act 
exactly the same in all contexts.

There’s no benefit to this change that I can see within PHP (perhaps with other 
languages that have weird JSON parsers), and it causes problems as I’ve said 
above. Thus, I can’t support it being a default.

--
Andrea Faulds
http://ajf.me/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to