{"action":"created","comment":{"url":"https://api.github.com/repos/php/php-src/pulls/comments/58674082","id":58674082,"diff_hunk":"@@ -764,6 +787,128 @@ static int zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zv\n \treturn 1;\n }\n \n+zend_property_info* zend_object_fetch_property_type_info_ex(zval *object, zend_string *property, void **cache_slot) {\n+\tzend_property_info *info = NULL;\n+\t\n+\tif (cache_slot && EXPECTED(Z_OBJCE_P(object) == CACHED_PTR_EX(cache_slot))) {\n+\t\tzend_property_info *cached = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2);\n+\n+\t\treturn (cached && cached->type) ? cached : NULL;\n+\t}\n+\n+\tinfo = zend_get_property_info(Z_OBJCE_P(object), property, 1);\n+\n+\tif (UNEXPECTED(info && info != ZEND_WRONG_PROPERTY_INFO && info->type)) {\n+\t\treturn info;\n+\t}\n+\n+\treturn NULL;\n+}\n+\n+zend_property_info* zend_object_fetch_property_type_info(zval *object, zval *property, void **cache_slot)\n+{\n+\tif (cache_slot && EXPECTED(Z_OBJCE_P(object) == CACHED_PTR_EX(cache_slot))) {\n+\t\tzend_property_info *info = (zend_property_info*)CACHED_PTR_EX(cache_slot + 2);\n+\n+\t\treturn (info && info->type) ? info : NULL;\n+\t}\n+\n+\tdo {\n+\t\tif (UNEXPECTED(Z_TYPE_P(property) != IS_STRING)) {\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tif (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {\n+\t\t\tif (Z_ISREF_P(object)) {\n+\t\t\t\tobject = Z_REFVAL_P(object);\n+\t\t\t\tif (Z_TYPE_P(object) != IS_OBJECT)\n+\t\t\t\t\tbreak;\n+\t\t\t} else {\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\treturn zend_object_fetch_property_type_info_ex(object, Z_STR_P(property), cache_slot);\n+\t} while (0);\n+\n+\treturn NULL;\n+}\n+\n+static inline zend_bool zend_verify_scalar_property_type(zend_uchar type, zval *property, zend_bool strict) {\n+\tif (EXPECTED(!strict)) {\n+\t\tif (UNEXPECTED(!ZEND_SAME_FAKE_TYPE(type, Z_TYPE_P(property)))) {\n+\t\t\treturn zend_verify_weak_scalar_type_hint(type, property);\n+\t\t}\n+\t\treturn 1;\n+\t}\n+\n+\tif (UNEXPECTED(type == IS_DOUBLE && Z_TYPE_P(property) == IS_LONG)) {\n+\t\tdouble dest = (double) Z_LVAL_P(property);\n+\t\tzval_ptr_dtor(property);\n+\t\tZVAL_DOUBLE(property, dest);\n+\t\treturn 1;\n+\t}\n+\n+\treturn ZEND_SAME_FAKE_TYPE(type, Z_TYPE_P(property));\n+}\n+\n+void zend_verify_property_type_error(zend_property_info *info, zend_string *name, zval *property) {\n+\tzend_string *resolved = zend_resolve_property_type(info->type_name, info->ce);\n+\t\n+\tif (info->type == IS_OBJECT) {\n+\t\tzend_throw_exception_ex(zend_ce_type_error, info->type, \n+\t\t\t\t\t\"Typed property %s::$%s must be an instance of %s, %s used\",\n+\t\t\t\t\t\tZSTR_VAL(info->ce->name),\n+\t\t\t\t\t\tZSTR_VAL(name),\n+\t\t\t\t\t\tZSTR_VAL(resolved),\n+\t\t\t\t\t\tZ_TYPE_P(property) == IS_OBJECT ?\n+\t\t\t\t\t\t\tZSTR_VAL(Z_OBJCE_P(property)->name) :\n+\t\t\t\t\t\t\tzend_get_type_by_const(Z_TYPE_P(property)));\n+\t} else {\n+\t\tzend_throw_exception_ex(zend_ce_type_error, info->type, \n+\t\t\t\t\t\"Typed property %s::$%s must be %s, %s used\",\n+\t\t\t\t\t\tZSTR_VAL(info->ce->name),\n+\t\t\t\t\t\tZSTR_VAL(name),\n+\t\t\t\t\t\tzend_get_type_by_const(info->type),\n+\t\t\t\t\t\tZ_TYPE_P(property) == IS_OBJECT ?\n+\t\t\t\t\t\t\tZSTR_VAL(Z_OBJCE_P(property)->name) :\n+\t\t\t\t\t\t\tzend_get_type_by_const(Z_TYPE_P(property)));\n+\t}\n+}\n+\n+zend_bool zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict) {\n+\tswitch (info->type) {\n+\t\tcase IS_OBJECT: {\n+\t\t\tzend_string *resolved = zend_resolve_property_type(info->type_name, info->ce);\n+\t\t\t\n+\t\t\tif (!info->type_ce) {\n+\t\t\t\tinfo->type_ce = zend_lookup_class(resolved);","path":"Zend/zend_execute.c","position":129,"original_position":129,"commit_id":"46742861d254a5fe74b6d88dde4232e4bae4bb5c","original_commit_id":"46742861d254a5fe74b6d88dde4232e4bae4bb5c","user":{"login":"dstogov","id":2510034,"avatar_url":"https://avatars.githubusercontent.com/u/2510034?v=3","gravatar_id":"","url":"https://api.github.com/users/dstogov","html_url":"https://github.com/dstogov","followers_url":"https://api.github.com/users/dstogov/followers","following_url":"https://api.github.com/users/dstogov/following{/other_user}","gists_url":"https://api.github.com/users/dstogov/gists{/gist_id}","starred_url":"https://api.github.com/users/dstogov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstogov/subscriptions","organizations_url":"https://api.github.com/users/dstogov/orgs","repos_url":"https://api.github.com/users/dstogov/repos","events_url":"https://api.github.com/users/dstogov/events{/privacy}","received_events_url":"https://api.github.com/users/dstogov/received_events","type":"User","site_admin":false},"body":"This won't work for typed properties of internal classes. info->type_ce won't be reset to NULL at the end of request and is going to be invalid on next request.","created_at":"2016-04-06T09:10:03Z","updated_at":"2016-04-06T09:10:03Z","html_url":"https://github.com/php/php-src/pull/1797#discussion_r58674082","pull_request_url":"https://api.github.com/repos/php/php-src/pulls/1797","_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/comments/58674082"},"html":{"href":"https://github.com/php/php-src/pull/1797#discussion_r58674082"},"pull_request":{"href":"https://api.github.com/repos/php/php-src/pulls/1797"}}},"pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/1797","id":62345323,"html_url":"https://github.com/php/php-src/pull/1797","diff_url":"https://github.com/php/php-src/pull/1797.diff","patch_url":"https://github.com/php/php-src/pull/1797.patch","issue_url":"https://api.github.com/repos/php/php-src/issues/1797","number":1797,"state":"open","locked":false,"title":"Typed Properties","user":{"login":"krakjoe","id":2236138,"avatar_url":"https://avatars.githubusercontent.com/u/2236138?v=3","gravatar_id":"","url":"https://api.github.com/users/krakjoe","html_url":"https://github.com/krakjoe","followers_url":"https://api.github.com/users/krakjoe/followers","following_url":"https://api.github.com/users/krakjoe/following{/other_user}","gists_url":"https://api.github.com/users/krakjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/krakjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krakjoe/subscriptions","organizations_url":"https://api.github.com/users/krakjoe/orgs","repos_url":"https://api.github.com/users/krakjoe/repos","events_url":"https://api.github.com/users/krakjoe/events{/privacy}","received_events_url":"https://api.github.com/users/krakjoe/received_events","type":"User","site_admin":false},"body":"[RFC](http://wiki.php.net/rfc/typed-properties)","created_at":"2016-03-10T06:28:50Z","updated_at":"2016-04-06T09:10:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4a82212134bef5cc38d32b27a7e32f6a837f4df","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php/php-src/pulls/1797/commits","review_comments_url":"https://api.github.com/repos/php/php-src/pulls/1797/comments","review_comment_url":"https://api.github.com/repos/php/php-src/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php/php-src/issues/1797/comments","statuses_url":"https://api.github.com/repos/php/php-src/statuses/46742861d254a5fe74b6d88dde4232e4bae4bb5c","head":{"label":"krakjoe:typed-properties","ref":"typed-properties","sha":"46742861d254a5fe74b6d88dde4232e4bae4bb5c","user":{"login":"krakjoe","id":2236138,"avatar_url":"https://avatars.githubusercontent.com/u/2236138?v=3","gravatar_id":"","url":"https://api.github.com/users/krakjoe","html_url":"https://github.com/krakjoe","followers_url":"https://api.github.com/users/krakjoe/followers","following_url":"https://api.github.com/users/krakjoe/following{/other_user}","gists_url":"https://api.github.com/users/krakjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/krakjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krakjoe/subscriptions","organizations_url":"https://api.github.com/users/krakjoe/orgs","repos_url":"https://api.github.com/users/krakjoe/repos","events_url":"https://api.github.com/users/krakjoe/events{/privacy}","received_events_url":"https://api.github.com/users/krakjoe/received_events","type":"User","site_admin":false},"repo":{"id":14134634,"name":"php-src","full_name":"krakjoe/php-src","owner":{"login":"krakjoe","id":2236138,"avatar_url":"https://avatars.githubusercontent.com/u/2236138?v=3","gravatar_id":"","url":"https://api.github.com/users/krakjoe","html_url":"https://github.com/krakjoe","followers_url":"https://api.github.com/users/krakjoe/followers","following_url":"https://api.github.com/users/krakjoe/following{/other_user}","gists_url":"https://api.github.com/users/krakjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/krakjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krakjoe/subscriptions","organizations_url":"https://api.github.com/users/krakjoe/orgs","repos_url":"https://api.github.com/users/krakjoe/repos","events_url":"https://api.github.com/users/krakjoe/events{/privacy}","received_events_url":"https://api.github.com/users/krakjoe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krakjoe/php-src","description":"The PHP Interpreter","fork":true,"url":"https://api.github.com/repos/krakjoe/php-src","forks_url":"https://api.github.com/repos/krakjoe/php-src/forks","keys_url":"https://api.github.com/repos/krakjoe/php-src/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krakjoe/php-src/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krakjoe/php-src/teams","hooks_url":"https://api.github.com/repos/krakjoe/php-src/hooks","issue_events_url":"https://api.github.com/repos/krakjoe/php-src/issues/events{/number}","events_url":"https://api.github.com/repos/krakjoe/php-src/events","assignees_url":"https://api.github.com/repos/krakjoe/php-src/assignees{/user}","branches_url":"https://api.github.com/repos/krakjoe/php-src/branches{/branch}","tags_url":"https://api.github.com/repos/krakjoe/php-src/tags","blobs_url":"https://api.github.com/repos/krakjoe/php-src/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krakjoe/php-src/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krakjoe/php-src/git/refs{/sha}","trees_url":"https://api.github.com/repos/krakjoe/php-src/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krakjoe/php-src/statuses/{sha}","languages_url":"https://api.github.com/repos/krakjoe/php-src/languages","stargazers_url":"https://api.github.com/repos/krakjoe/php-src/stargazers","contributors_url":"https://api.github.com/repos/krakjoe/php-src/contributors","subscribers_url":"https://api.github.com/repos/krakjoe/php-src/subscribers","subscription_url":"https://api.github.com/repos/krakjoe/php-src/subscription","commits_url":"https://api.github.com/repos/krakjoe/php-src/commits{/sha}","git_commits_url":"https://api.github.com/repos/krakjoe/php-src/git/commits{/sha}","comments_url":"https://api.github.com/repos/krakjoe/php-src/comments{/number}","issue_comment_url":"https://api.github.com/repos/krakjoe/php-src/issues/comments{/number}","contents_url":"https://api.github.com/repos/krakjoe/php-src/contents/{+path}","compare_url":"https://api.github.com/repos/krakjoe/php-src/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krakjoe/php-src/merges","archive_url":"https://api.github.com/repos/krakjoe/php-src/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krakjoe/php-src/downloads","issues_url":"https://api.github.com/repos/krakjoe/php-src/issues{/number}","pulls_url":"https://api.github.com/repos/krakjoe/php-src/pulls{/number}","milestones_url":"https://api.github.com/repos/krakjoe/php-src/milestones{/number}","notifications_url":"https://api.github.com/repos/krakjoe/php-src/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krakjoe/php-src/labels{/name}","releases_url":"https://api.github.com/repos/krakjoe/php-src/releases{/id}","deployments_url":"https://api.github.com/repos/krakjoe/php-src/deployments","created_at":"2013-11-05T07:10:45Z","updated_at":"2015-03-13T17:49:32Z","pushed_at":"2016-04-06T07:58:56Z","git_url":"git://github.com/krakjoe/php-src.git","ssh_url":"git@github.com:krakjoe/php-src.git","clone_url":"https://github.com/krakjoe/php-src.git","svn_url":"https://github.com/krakjoe/php-src","homepage":"http://www.php.net","size":266983,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"php:master","ref":"master","sha":"b68e89ee7e0f53533e33e13b25c3b57c63486082","user":{"login":"php","id":25158,"avatar_url":"https://avatars.githubusercontent.com/u/25158?v=3","gravatar_id":"","url":"https://api.github.com/users/php","html_url":"https://github.com/php","followers_url":"https://api.github.com/users/php/followers","following_url":"https://api.github.com/users/php/following{/other_user}","gists_url":"https://api.github.com/users/php/gists{/gist_id}","starred_url":"https://api.github.com/users/php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php/subscriptions","organizations_url":"https://api.github.com/users/php/orgs","repos_url":"https://api.github.com/users/php/repos","events_url":"https://api.github.com/users/php/events{/privacy}","received_events_url":"https://api.github.com/users/php/received_events","type":"Organization","site_admin":false},"repo":{"id":1903522,"name":"php-src","full_name":"php/php-src","owner":{"login":"php","id":25158,"avatar_url":"https://avatars.githubusercontent.com/u/25158?v=3","gravatar_id":"","url":"https://api.github.com/users/php","html_url":"https://github.com/php","followers_url":"https://api.github.com/users/php/followers","following_url":"https://api.github.com/users/php/following{/other_user}","gists_url":"https://api.github.com/users/php/gists{/gist_id}","starred_url":"https://api.github.com/users/php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php/subscriptions","organizations_url":"https://api.github.com/users/php/orgs","repos_url":"https://api.github.com/users/php/repos","events_url":"https://api.github.com/users/php/events{/privacy}","received_events_url":"https://api.github.com/users/php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php/php-src","description":"The PHP Interpreter","fork":false,"url":"https://api.github.com/repos/php/php-src","forks_url":"https://api.github.com/repos/php/php-src/forks","keys_url":"https://api.github.com/repos/php/php-src/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php/php-src/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php/php-src/teams","hooks_url":"https://api.github.com/repos/php/php-src/hooks","issue_events_url":"https://api.github.com/repos/php/php-src/issues/events{/number}","events_url":"https://api.github.com/repos/php/php-src/events","assignees_url":"https://api.github.com/repos/php/php-src/assignees{/user}","branches_url":"https://api.github.com/repos/php/php-src/branches{/branch}","tags_url":"https://api.github.com/repos/php/php-src/tags","blobs_url":"https://api.github.com/repos/php/php-src/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php/php-src/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php/php-src/git/refs{/sha}","trees_url":"https://api.github.com/repos/php/php-src/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php/php-src/statuses/{sha}","languages_url":"https://api.github.com/repos/php/php-src/languages","stargazers_url":"https://api.github.com/repos/php/php-src/stargazers","contributors_url":"https://api.github.com/repos/php/php-src/contributors","subscribers_url":"https://api.github.com/repos/php/php-src/subscribers","subscription_url":"https://api.github.com/repos/php/php-src/subscription","commits_url":"https://api.github.com/repos/php/php-src/commits{/sha}","git_commits_url":"https://api.github.com/repos/php/php-src/git/commits{/sha}","comments_url":"https://api.github.com/repos/php/php-src/comments{/number}","issue_comment_url":"https://api.github.com/repos/php/php-src/issues/comments{/number}","contents_url":"https://api.github.com/repos/php/php-src/contents/{+path}","compare_url":"https://api.github.com/repos/php/php-src/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php/php-src/merges","archive_url":"https://api.github.com/repos/php/php-src/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php/php-src/downloads","issues_url":"https://api.github.com/repos/php/php-src/issues{/number}","pulls_url":"https://api.github.com/repos/php/php-src/pulls{/number}","milestones_url":"https://api.github.com/repos/php/php-src/milestones{/number}","notifications_url":"https://api.github.com/repos/php/php-src/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php/php-src/labels{/name}","releases_url":"https://api.github.com/repos/php/php-src/releases{/id}","deployments_url":"https://api.github.com/repos/php/php-src/deployments","created_at":"2011-06-16T01:52:25Z","updated_at":"2016-04-06T07:49:57Z","pushed_at":"2016-04-06T07:58:57Z","git_url":"git://github.com/php/php-src.git","ssh_url":"git@github.com:php/php-src.git","clone_url":"https://github.com/php/php-src.git","svn_url":"https://github.com/php/php-src","homepage":"http://www.php.net","size":307443,"stargazers_count":8930,"watchers_count":8930,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3062,"mirror_url":null,"open_issues_count":307,"forks":3062,"open_issues":307,"watchers":8930,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/1797"},"html":{"href":"https://github.com/php/php-src/pull/1797"},"issue":{"href":"https://api.github.com/repos/php/php-src/issues/1797"},"comments":{"href":"https://api.github.com/repos/php/php-src/issues/1797/comments"},"review_comments":{"href":"https://api.github.com/repos/php/php-src/pulls/1797/comments"},"review_comment":{"href":"https://api.github.com/repos/php/php-src/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php/php-src/pulls/1797/commits"},"statuses":{"href":"https://api.github.com/repos/php/php-src/statuses/46742861d254a5fe74b6d88dde4232e4bae4bb5c"}}}}