{"action":"created","comment":{"url":"https://api.github.com/repos/php/php-src/pulls/comments/27348766","id":27348766,"diff_hunk":"@@ -2987,7 +3228,26 @@ void zend_compile_new(znode *result, zend_ast *ast) /* {{{ */\n \t\tclass_node.op_type = IS_CONST;\n \t\tZVAL_STR(&class_node.u.constant, zend_resolve_class_name_ast(class_ast));\n \t} else {\n-\t\tzend_compile_class_ref(&class_node, class_ast);\n+\t\tif (class_ast->kind == ZEND_AST_CLASS) {\n+\t\tzend_class_entry *ce = \n+\t\t    zend_compile_class_decl(class_ast TSRMLS_CC);\n+\t\tzend_string *name = ce->name;\n+\t\tuint32_t fetch_type = zend_get_class_fetch_type(name);\n+\t\t\n+\t\topline = zend_emit_op(&class_node,\n+\t\t    ZEND_FETCH_CLASS, NULL, NULL TSRMLS_CC);\n+\t\t\topline->extended_value = fetch_type;\n+\t\t\n+\t\t\tif (fetch_type == ZEND_FETCH_CLASS_DEFAULT) {\n+\t\t\t    opline->op2_type = IS_CONST;\n+\t\t\t    opline->op2.constant = zend_add_class_name_literal(CG(active_op_array),\n+\t\t\t\tzend_resolve_class_name(name, ZEND_NAME_FQ TSRMLS_CC) TSRMLS_CC);\n+\t\t\t}","path":"Zend/zend_compile.c","position":302,"original_position":302,"commit_id":"3254e98d40c2fb8467b0db58eed8c8e8656748a3","original_commit_id":"3254e98d40c2fb8467b0db58eed8c8e8656748a3","user":{"login":"nikic","id":216080,"avatar_url":"https://avatars.githubusercontent.com/u/216080?v=3","gravatar_id":"","url":"https://api.github.com/users/nikic","html_url":"https://github.com/nikic","followers_url":"https://api.github.com/users/nikic/followers","following_url":"https://api.github.com/users/nikic/following{/other_user}","gists_url":"https://api.github.com/users/nikic/gists{/gist_id}","starred_url":"https://api.github.com/users/nikic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikic/subscriptions","organizations_url":"https://api.github.com/users/nikic/orgs","repos_url":"https://api.github.com/users/nikic/repos","events_url":"https://api.github.com/users/nikic/events{/privacy}","received_events_url":"https://api.github.com/users/nikic/received_events","type":"User","site_admin":false},"body":"For anon classes the fetch_type must always be `ZEND_FETCH_CLASS_DEFAULT` - so this should not be emitting a class fetch and instead directly stick the name in `class_node` (like in the const_default_class_ref case). You also don't need to resolve the name, it's already the canonical one.\r\n\r\nThere are a few lines above this where the indent is a bit off.","created_at":"2015-03-28T21:33:16Z","updated_at":"2015-03-28T21:33:16Z","html_url":"https://github.com/php/php-src/pull/1118#discussion_r27348766","pull_request_url":"https://api.github.com/repos/php/php-src/pulls/1118","_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/comments/27348766"},"html":{"href":"https://github.com/php/php-src/pull/1118#discussion_r27348766"},"pull_request":{"href":"https://api.github.com/repos/php/php-src/pulls/1118"}}},"pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/1118","id":29915828,"html_url":"https://github.com/php/php-src/pull/1118","diff_url":"https://github.com/php/php-src/pull/1118.diff","patch_url":"https://github.com/php/php-src/pull/1118.patch","issue_url":"https://api.github.com/repos/php/php-src/issues/1118","number":1118,"state":"open","locked":false,"title":"Anonymous Classes","user":{"login":"philsturgeon","id":67381,"avatar_url":"https://avatars.githubusercontent.com/u/67381?v=3","gravatar_id":"","url":"https://api.github.com/users/philsturgeon","html_url":"https://github.com/philsturgeon","followers_url":"https://api.github.com/users/philsturgeon/followers","following_url":"https://api.github.com/users/philsturgeon/following{/other_user}","gists_url":"https://api.github.com/users/philsturgeon/gists{/gist_id}","starred_url":"https://api.github.com/users/philsturgeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philsturgeon/subscriptions","organizations_url":"https://api.github.com/users/philsturgeon/orgs","repos_url":"https://api.github.com/users/philsturgeon/repos","events_url":"https://api.github.com/users/philsturgeon/events{/privacy}","received_events_url":"https://api.github.com/users/philsturgeon/received_events","type":"User","site_admin":false},"body":"**RFC:** https://wiki.php.net/rfc/anonymous_classes\r\n\r\nThis is a work in progress right now and the RFC is being worked on, as are the tests.\r\n\r\nPlease keep feature discussions to the [mailing list](http://marc.info/?l=php-internals&m=142478600309800&w=2).","created_at":"2015-02-24T17:06:08Z","updated_at":"2015-03-28T21:33:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php/php-src/pulls/1118/commits","review_comments_url":"https://api.github.com/repos/php/php-src/pulls/1118/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/1118/comments","statuses_url":"https://api.github.com/repos/php/php-src/statuses/3254e98d40c2fb8467b0db58eed8c8e8656748a3","head":{"label":"krakjoe:anon","ref":"anon","sha":"3254e98d40c2fb8467b0db58eed8c8e8656748a3","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}","created_at":"2013-11-05T07:10:45Z","updated_at":"2015-03-13T17:49:32Z","pushed_at":"2015-03-15T05:07:11Z","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":215077,"stargazers_count":0,"watchers_count":0,"language":"C","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":"php:master","ref":"master","sha":"0ef5a6b409f5904a7841aed485c0de72c95b5e6f","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}","created_at":"2011-06-16T01:52:25Z","updated_at":"2015-03-28T16:30:55Z","pushed_at":"2015-03-28T13:18:37Z","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":1334881,"stargazers_count":5620,"watchers_count":5620,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2011,"mirror_url":null,"open_issues_count":178,"forks":2011,"open_issues":178,"watchers":5620,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php/php-src/pulls/1118"},"html":{"href":"https://github.com/php/php-src/pull/1118"},"issue":{"href":"https://api.github.com/repos/php/php-src/issues/1118"},"comments":{"href":"https://api.github.com/repos/php/php-src/issues/1118/comments"},"review_comments":{"href":"https://api.github.com/repos/php/php-src/pulls/1118/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/1118/commits"},"statuses":{"href":"https://api.github.com/repos/php/php-src/statuses/3254e98d40c2fb8467b0db58eed8c8e8656748a3"}}}}