{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/comments/89358622","pull_request_review_id":9904823,"id":89358622,"diff_hunk":"@@ -161,49 +157,58 @@ static bool php_phongo_utcdatetime_init_from_date(php_phongo_utcdatetime_t *inte\n \treturn true;\n }\n \n-/* {{{ proto void UTCDateTime::__construct([string|DateTimeInterface $milliseconds = null])\n+/* {{{ proto void UTCDateTime::__construct([int|float|string|DateTimeInterface $milliseconds = null])\n    Construct a new BSON UTCDateTime type from either the current time,\n-   milliseconds since the epoch, or a DateTimeInterface object. */\n+   milliseconds since the epoch, or a DateTimeInterface object. Defaults to the\n+   current time. */\n PHP_METHOD(UTCDateTime, __construct)\n {\n \tphp_phongo_utcdatetime_t    *intern;\n \tzend_error_handling          error_handling;\n-\tzval                        *datetime = NULL;\n+\tzval                        *milliseconds = NULL;\n \n \tzend_replace_error_handling(EH_THROW, phongo_exception_from_phongo_domain(PHONGO_ERROR_INVALID_ARGUMENT), &error_handling TSRMLS_CC);\n \tintern = Z_UTCDATETIME_OBJ_P(getThis());\n \n-\tif (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, \"|o!\", &datetime) == SUCCESS) {\n-\t\tif (datetime == NULL) {\n-\t\t\tphp_phongo_utcdatetime_init_from_current_time(intern);\n-\t\t} else if (instanceof_function(Z_OBJCE_P(datetime), php_date_get_date_ce() TSRMLS_CC)) {\n-\t\t\tphp_phongo_utcdatetime_init_from_date(intern, Z_PHPDATE_P(datetime));\n+\tif (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, \"|z!\", &milliseconds) == FAILURE) {\n+\t\tzend_restore_error_handling(&error_handling TSRMLS_CC);\n+\t\treturn;\n+\t}\n+\tzend_restore_error_handling(&error_handling TSRMLS_CC);\n+\n+\tif (milliseconds == NULL) {\n+\t\tphp_phongo_utcdatetime_init_from_current_time(intern);\n+\t\treturn;\n+\t}\n+\n+\tif (Z_TYPE_P(milliseconds) == IS_OBJECT) {\n+\t\tif (instanceof_function(Z_OBJCE_P(milliseconds), php_date_get_date_ce() TSRMLS_CC)) {\n+\t\t\tphp_phongo_utcdatetime_init_from_date(intern, Z_PHPDATE_P(milliseconds));\n #if PHP_VERSION_ID >= 50500\n-\t\t} else if (instanceof_function(Z_OBJCE_P(datetime), php_date_get_immutable_ce() TSRMLS_CC)) {\n-\t\t\tphp_phongo_utcdatetime_init_from_date(intern, Z_PHPDATE_P(datetime));\n+\t\t} else if (instanceof_function(Z_OBJCE_P(milliseconds), php_date_get_immutable_ce() TSRMLS_CC)) {\n+\t\t\tphp_phongo_utcdatetime_init_from_date(intern, Z_PHPDATE_P(milliseconds));\n #endif\n \t\t} else {\n-\t\t\tphongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, \"Expected instance of DateTimeInterface, %s given\", ZSTR_VAL(Z_OBJCE_P(datetime)->name));\n+\t\t\tphongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, \"Expected instance of DateTimeInterface, %s given\", ZSTR_VAL(Z_OBJCE_P(milliseconds)->name));\n \t\t}\n-\n-\t\tzend_restore_error_handling(&error_handling TSRMLS_CC);\n \t\treturn;\n \t}\n \n-\t{\n-\t\tchar                *s_milliseconds;\n-\t\tphongo_zpp_char_len  s_milliseconds_len;\n-\n-\t\tif (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, \"s\", &s_milliseconds, &s_milliseconds_len) == FAILURE) {\n-\t\t\tzend_restore_error_handling(&error_handling TSRMLS_CC);\n-\t\t\treturn;\n-\t\t}\n+\tif (Z_TYPE_P(milliseconds) == IS_DOUBLE) {","path":"src/BSON/UTCDateTime.c","position":74,"original_position":74,"commit_id":"e8630275383c03b48b6f8b54782211f40a653154","original_commit_id":"e8630275383c03b48b6f8b54782211f40a653154","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},"body":"Yes, I agree. That should be handled.","created_at":"2016-11-23T17:00:22Z","updated_at":"2016-11-23T17:00:57Z","html_url":"https://github.com/mongodb/mongo-php-driver/pull/467#discussion_r89358622","pull_request_url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/comments/89358622"},"html":{"href":"https://github.com/mongodb/mongo-php-driver/pull/467#discussion_r89358622"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467","id":94890037,"html_url":"https://github.com/mongodb/mongo-php-driver/pull/467","diff_url":"https://github.com/mongodb/mongo-php-driver/pull/467.diff","patch_url":"https://github.com/mongodb/mongo-php-driver/pull/467.patch","issue_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/467","number":467,"state":"open","locked":false,"title":"PHPC-790: Accept integer and floats in Timestamp and UTCDateTime constructors","user":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"body":"https://jira.mongodb.org/browse/PHPC-790\r\nhttps://jira.mongodb.org/browse/PHPC-804","created_at":"2016-11-22T20:16:35Z","updated_at":"2016-11-23T17:00:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7c6d134279323dbd5a1745b1d1085c12502894c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467/commits","review_comments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467/comments","review_comment_url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/467/comments","statuses_url":"https://api.github.com/repos/mongodb/mongo-php-driver/statuses/e8630275383c03b48b6f8b54782211f40a653154","head":{"label":"jmikola:phpc-790","ref":"phpc-790","sha":"e8630275383c03b48b6f8b54782211f40a653154","user":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"repo":{"id":32424485,"name":"mongo-php-driver","full_name":"jmikola/mongo-php-driver","owner":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmikola/mongo-php-driver","description":"MongoDB PHP driver","fork":true,"url":"https://api.github.com/repos/jmikola/mongo-php-driver","forks_url":"https://api.github.com/repos/jmikola/mongo-php-driver/forks","keys_url":"https://api.github.com/repos/jmikola/mongo-php-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmikola/mongo-php-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmikola/mongo-php-driver/teams","hooks_url":"https://api.github.com/repos/jmikola/mongo-php-driver/hooks","issue_events_url":"https://api.github.com/repos/jmikola/mongo-php-driver/issues/events{/number}","events_url":"https://api.github.com/repos/jmikola/mongo-php-driver/events","assignees_url":"https://api.github.com/repos/jmikola/mongo-php-driver/assignees{/user}","branches_url":"https://api.github.com/repos/jmikola/mongo-php-driver/branches{/branch}","tags_url":"https://api.github.com/repos/jmikola/mongo-php-driver/tags","blobs_url":"https://api.github.com/repos/jmikola/mongo-php-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmikola/mongo-php-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmikola/mongo-php-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmikola/mongo-php-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmikola/mongo-php-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/jmikola/mongo-php-driver/languages","stargazers_url":"https://api.github.com/repos/jmikola/mongo-php-driver/stargazers","contributors_url":"https://api.github.com/repos/jmikola/mongo-php-driver/contributors","subscribers_url":"https://api.github.com/repos/jmikola/mongo-php-driver/subscribers","subscription_url":"https://api.github.com/repos/jmikola/mongo-php-driver/subscription","commits_url":"https://api.github.com/repos/jmikola/mongo-php-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmikola/mongo-php-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmikola/mongo-php-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmikola/mongo-php-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmikola/mongo-php-driver/contents/{+path}","compare_url":"https://api.github.com/repos/jmikola/mongo-php-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmikola/mongo-php-driver/merges","archive_url":"https://api.github.com/repos/jmikola/mongo-php-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmikola/mongo-php-driver/downloads","issues_url":"https://api.github.com/repos/jmikola/mongo-php-driver/issues{/number}","pulls_url":"https://api.github.com/repos/jmikola/mongo-php-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/jmikola/mongo-php-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/jmikola/mongo-php-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmikola/mongo-php-driver/labels{/name}","releases_url":"https://api.github.com/repos/jmikola/mongo-php-driver/releases{/id}","deployments_url":"https://api.github.com/repos/jmikola/mongo-php-driver/deployments","created_at":"2015-03-17T22:38:23Z","updated_at":"2016-10-24T14:02:27Z","pushed_at":"2016-11-22T21:17:12Z","git_url":"git://github.com/jmikola/mongo-php-driver.git","ssh_url":"git@github.com:jmikola/mongo-php-driver.git","clone_url":"https://github.com/jmikola/mongo-php-driver.git","svn_url":"https://github.com/jmikola/mongo-php-driver","homepage":"https://pecl.php.net/package/mongodb","size":3407,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mongodb:master","ref":"master","sha":"e0b83d83185b17069d7f5bac2a12198c73ca666c","user":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":19514152,"name":"mongo-php-driver","full_name":"mongodb/mongo-php-driver","owner":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mongodb/mongo-php-driver","description":"MongoDB PHP driver","fork":false,"url":"https://api.github.com/repos/mongodb/mongo-php-driver","forks_url":"https://api.github.com/repos/mongodb/mongo-php-driver/forks","keys_url":"https://api.github.com/repos/mongodb/mongo-php-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/mongo-php-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/mongo-php-driver/teams","hooks_url":"https://api.github.com/repos/mongodb/mongo-php-driver/hooks","issue_events_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/mongo-php-driver/events","assignees_url":"https://api.github.com/repos/mongodb/mongo-php-driver/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/mongo-php-driver/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/mongo-php-driver/tags","blobs_url":"https://api.github.com/repos/mongodb/mongo-php-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/mongo-php-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/mongo-php-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/mongo-php-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/mongo-php-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/mongo-php-driver/languages","stargazers_url":"https://api.github.com/repos/mongodb/mongo-php-driver/stargazers","contributors_url":"https://api.github.com/repos/mongodb/mongo-php-driver/contributors","subscribers_url":"https://api.github.com/repos/mongodb/mongo-php-driver/subscribers","subscription_url":"https://api.github.com/repos/mongodb/mongo-php-driver/subscription","commits_url":"https://api.github.com/repos/mongodb/mongo-php-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/mongo-php-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/mongo-php-driver/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/mongo-php-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/mongo-php-driver/merges","archive_url":"https://api.github.com/repos/mongodb/mongo-php-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/mongo-php-driver/downloads","issues_url":"https://api.github.com/repos/mongodb/mongo-php-driver/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/mongo-php-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/mongo-php-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/mongo-php-driver/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/mongo-php-driver/releases{/id}","deployments_url":"https://api.github.com/repos/mongodb/mongo-php-driver/deployments","created_at":"2014-05-06T23:18:32Z","updated_at":"2016-11-22T04:16:50Z","pushed_at":"2016-11-23T16:15:51Z","git_url":"git://github.com/mongodb/mongo-php-driver.git","ssh_url":"git@github.com:mongodb/mongo-php-driver.git","clone_url":"https://github.com/mongodb/mongo-php-driver.git","svn_url":"https://github.com/mongodb/mongo-php-driver","homepage":"https://pecl.php.net/package/mongodb","size":5019,"stargazers_count":292,"watchers_count":292,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":21,"forks":89,"open_issues":21,"watchers":292,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467"},"html":{"href":"https://github.com/mongodb/mongo-php-driver/pull/467"},"issue":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/467"},"comments":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/issues/467/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/pulls/467/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/mongo-php-driver/statuses/e8630275383c03b48b6f8b54782211f40a653154"}}}}
{"actor":{"display_login":"derickr"}}