{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4927","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4927/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4927/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4927/events","html_url":"https://github.com/facebook/hhvm/issues/4927","id":59454296,"number":4927,"title":"Function or method as value in collection throws syntax error","user":{"login":"weactivist","id":4085104,"avatar_url":"https://avatars.githubusercontent.com/u/4085104?v=3","gravatar_id":"","url":"https://api.github.com/users/weactivist","html_url":"https://github.com/weactivist","followers_url":"https://api.github.com/users/weactivist/followers","following_url":"https://api.github.com/users/weactivist/following{/other_user}","gists_url":"https://api.github.com/users/weactivist/gists{/gist_id}","starred_url":"https://api.github.com/users/weactivist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weactivist/subscriptions","organizations_url":"https://api.github.com/users/weactivist/orgs","repos_url":"https://api.github.com/users/weactivist/repos","events_url":"https://api.github.com/users/weactivist/events{/privacy}","received_events_url":"https://api.github.com/users/weactivist/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/hhvm/labels/feature%20request","name":"feature request","color":"ededed"},{"url":"https://api.github.com/repos/facebook/hhvm/labels/probably%20easy","name":"probably easy","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-02T09:02:27Z","updated_at":"2015-03-13T12:54:31Z","closed_at":"2015-03-12T22:13:21Z","body":"Adding a function or method as value in a collection throws:\r\n\r\n> \"Fatal error: syntax error, unexpected T_FUNCTION, expecting '}'\".\r\n\r\n    $collection = Vector {\r\n        function(){}\r\n    };\r\n\r\nTested on HHVM 3.6.0-dev\r\n\r\nConfirmed on Stack Overflow: http://stackoverflow.com/questions/28737637/function-or-method-as-value-in-collection/28749162#28749162"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/78958659","html_url":"https://github.com/facebook/hhvm/issues/4927#issuecomment-78958659","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4927","id":78958659,"user":{"login":"weactivist","id":4085104,"avatar_url":"https://avatars.githubusercontent.com/u/4085104?v=3","gravatar_id":"","url":"https://api.github.com/users/weactivist","html_url":"https://github.com/weactivist","followers_url":"https://api.github.com/users/weactivist/followers","following_url":"https://api.github.com/users/weactivist/following{/other_user}","gists_url":"https://api.github.com/users/weactivist/gists{/gist_id}","starred_url":"https://api.github.com/users/weactivist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weactivist/subscriptions","organizations_url":"https://api.github.com/users/weactivist/orgs","repos_url":"https://api.github.com/users/weactivist/repos","events_url":"https://api.github.com/users/weactivist/events{/privacy}","received_events_url":"https://api.github.com/users/weactivist/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T12:54:31Z","updated_at":"2015-03-13T12:54:31Z","body":"@nikic and @paulbiss  As you said this works. I've just tested now. I realise now I used a function as a value in a collection as property in a class. My bad. I'm sorry. This should throw the error as stated above.\r\n\r\n    <?hh // strict\r\n    class MyClass {\r\n        public Vector $vector = Vector {\r\n            function(){}\r\n        }\r\n    }\r\n    ?>"}}