PHP读取Mongodb数据报错,Cannot natively represent the long 8331412483000 on this platform

在使用PHP进行读取Mongo数据时,如果读取的int数据过大时,会自动转变为int64位。

并会报以下错误:

Cannot natively represent the long 8331412483000 on this platform

只要在需要的地方添加代码:

ini_set('mongo.long_as_object', 1);

原文地址:https://www.cnblogs.com/Mwsoft/p/5454450.html