{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/251","repository_url":"https://api.github.com/repos/mongodb/mongo-php-library","labels_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/251/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/251/comments","events_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/251/events","html_url":"https://github.com/mongodb/mongo-php-library/issues/251","id":179300540,"number":251,"title":"GridFS WritableStream throws exception with recent driver","user":{"login":"doublecompile","id":4267230,"avatar_url":"https://avatars.githubusercontent.com/u/4267230?v=3","gravatar_id":"","url":"https://api.github.com/users/doublecompile","html_url":"https://github.com/doublecompile","followers_url":"https://api.github.com/users/doublecompile/followers","following_url":"https://api.github.com/users/doublecompile/following{/other_user}","gists_url":"https://api.github.com/users/doublecompile/gists{/gist_id}","starred_url":"https://api.github.com/users/doublecompile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doublecompile/subscriptions","organizations_url":"https://api.github.com/users/doublecompile/orgs","repos_url":"https://api.github.com/users/doublecompile/repos","events_url":"https://api.github.com/users/doublecompile/events{/privacy}","received_events_url":"https://api.github.com/users/doublecompile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-26T18:18:41Z","updated_at":"2016-09-27T18:26:30Z","closed_at":null,"body":"I'm running HHVM 3.15 using the latest dev master HHVM Driver. Since [HHVM-162](https://jira.mongodb.org/browse/HHVM-162) was implemented, the `MongoDB\\GridFS\\WritableStream` constructor is throwing a `MongoDB\\Driver\\Exception\\InvalidArgumentException` exception because it's passing a float as a constructor argument to `UTCDateTime`.\r\n\r\n```\r\nError parsing \"1474912381598\" as 64-bit integer for MongoDB\\BSON\\UTCDateTime initialization\r\n#0 /usr/share/nginx/vendor/mongodb/mongodb/src/GridFS/WritableStream.php(88): MongoDB\\BSON\\UTCDateTime->__construct()\r\n#1 /usr/share/nginx/vendor/mongodb/mongodb/src/GridFS/StreamWrapper.php(228): MongoDB\\GridFS\\WritableStream->__construct()\r\n#2 /usr/share/nginx/vendor/mongodb/mongodb/src/GridFS/StreamWrapper.php(93): MongoDB\\GridFS\\StreamWrapper->initWritableStream()\r\n#3 (): MongoDB\\GridFS\\StreamWrapper->stream_open()\r\n#4 /usr/share/nginx/vendor/mongodb/mongodb/src/GridFS/Bucket.php(359): fopen()\r\n#5 /usr/share/nginx/vendor/mongodb/mongodb/src/GridFS/Bucket.php(416): MongoDB\\GridFS\\Bucket->openUploadStream()\r\n```\r\n\r\nThe line in question is:\r\n```php\r\n            'uploadDate' => new UTCDateTime(floor(microtime(true) * 1000)),\r\n```\r\nWhich, of course, bombs out because `UTCDateTime` doesn't accept `float` values any longer."},"comment":{"url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/comments/249953869","html_url":"https://github.com/mongodb/mongo-php-library/issues/251#issuecomment-249953869","issue_url":"https://api.github.com/repos/mongodb/mongo-php-library/issues/251","id":249953869,"user":{"login":"derickr","id":208074,"avatar_url":"https://avatars.githubusercontent.com/u/208074?v=3","gravatar_id":"","url":"https://api.github.com/users/derickr","html_url":"https://github.com/derickr","followers_url":"https://api.github.com/users/derickr/followers","following_url":"https://api.github.com/users/derickr/following{/other_user}","gists_url":"https://api.github.com/users/derickr/gists{/gist_id}","starred_url":"https://api.github.com/users/derickr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derickr/subscriptions","organizations_url":"https://api.github.com/users/derickr/orgs","repos_url":"https://api.github.com/users/derickr/repos","events_url":"https://api.github.com/users/derickr/events{/privacy}","received_events_url":"https://api.github.com/users/derickr/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T18:26:30Z","updated_at":"2016-09-27T18:26:30Z","body":"Passing in a float, will however, cause potential data loss without knowing about it. UTCDateTime only supports integers, so I consider this correct behaviour. The original allowing of float, was IMO a bug."}}
{"actor":{"display_login":"derickr"}}