Woo I didn't know this! When I mention twitter ids it was just an example.
So it can happen to anyone and it's a real issue for any JSON API.
For quite some time there were API calls in Facebook that would return the ID's as numbers, not strings. It wasn't specific to the entire API though, only some calls would show the behaviour. As you can imagine, PHP did not like it. It was rather irritating...
All of a sudden, tweet ids got rounded off to point to completely different entries!
https://dev.twitter.com/docs/twitter-ids-json-and-snowflake
Other JSON parsers may also be affected.