Facebook returning cover id as int, turns into float on my machine
Why would they not send this through as a string? My system converts this to a float and then I lose the accuracy of the id because it is rounding poorly. Am I missing something?
If you’re having this problem while using json_decode(?) – then just set the option JSON_BIGINT_AS_STRING as 4th parameter in the function call.
It is appearing as a float because you are suffering from integer overflow.
You will need to look into how your development environment handles 64 bit integers. You might need to specially add a bigint library, if there is not native support. BCMath is one such library
"If PHP encounters a number beyond the bounds of the integer type, it will be interpreted as a float instead." http://php.net/manual/en/language.types.integer.php