{"action":"created","issue":{"url":"https://api.github.com/repos/php/php-src/issues/1779","repository_url":"https://api.github.com/repos/php/php-src","labels_url":"https://api.github.com/repos/php/php-src/issues/1779/labels{/name}","comments_url":"https://api.github.com/repos/php/php-src/issues/1779/comments","events_url":"https://api.github.com/repos/php/php-src/issues/1779/events","html_url":"https://github.com/php/php-src/pull/1779","id":136946472,"number":1779,"title":"Allow \"self\" and \"parent\" as parent of anonymous classes","user":{"login":"thekid","id":696742,"avatar_url":"https://avatars.githubusercontent.com/u/696742?v=3","gravatar_id":"","url":"https://api.github.com/users/thekid","html_url":"https://github.com/thekid","followers_url":"https://api.github.com/users/thekid/followers","following_url":"https://api.github.com/users/thekid/following{/other_user}","gists_url":"https://api.github.com/users/thekid/gists{/gist_id}","starred_url":"https://api.github.com/users/thekid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thekid/subscriptions","organizations_url":"https://api.github.com/users/thekid/orgs","repos_url":"https://api.github.com/users/thekid/repos","events_url":"https://api.github.com/users/thekid/events{/privacy}","received_events_url":"https://api.github.com/users/thekid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-27T17:47:37Z","updated_at":"2016-02-27T18:59:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/php/php-src/pulls/1779","html_url":"https://github.com/php/php-src/pull/1779","diff_url":"https://github.com/php/php-src/pull/1779.diff","patch_url":"https://github.com/php/php-src/pull/1779.patch"},"body":"Fixes [bug 71678](https://bugs.php.net/bug.php?id=71678) and allows the following (*which currently gives a fatal error*):\r\n\r\n```php\r\nclass T {\r\n  static function new() {\r\n    return new class() extends self { };\r\n  }\r\n}\r\n\r\nvar_dump(T::new());\r\n```\r\n\r\nThe [original RFC](https://wiki.php.net/rfc/anonymous_classes) neither states this should be allowed nor that it is an error - maybe @philsturgeon and @krakjoe want to have a look at this?"},"comment":{"url":"https://api.github.com/repos/php/php-src/issues/comments/189702835","html_url":"https://github.com/php/php-src/pull/1779#issuecomment-189702835","issue_url":"https://api.github.com/repos/php/php-src/issues/1779","id":189702835,"user":{"login":"thekid","id":696742,"avatar_url":"https://avatars.githubusercontent.com/u/696742?v=3","gravatar_id":"","url":"https://api.github.com/users/thekid","html_url":"https://github.com/thekid","followers_url":"https://api.github.com/users/thekid/followers","following_url":"https://api.github.com/users/thekid/following{/other_user}","gists_url":"https://api.github.com/users/thekid/gists{/gist_id}","starred_url":"https://api.github.com/users/thekid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thekid/subscriptions","organizations_url":"https://api.github.com/users/thekid/orgs","repos_url":"https://api.github.com/users/thekid/repos","events_url":"https://api.github.com/users/thekid/events{/privacy}","received_events_url":"https://api.github.com/users/thekid/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T18:59:35Z","updated_at":"2016-02-27T18:59:35Z","body":"Oh, in HHVM this also yields a fatal error, but for a different reason:\r\n\r\n```sh\r\n$ php -r 'class T { static function new() { return new class() extends self { }; } } var_dump(T::new());'\r\n\r\nFatal error: unknown class self in /tmp/php-wrap-rylTB2 on line 2\r\n```"}}