{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4750","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4750/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4750/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4750/events","html_url":"https://github.com/facebook/hhvm/issues/4750","id":56151239,"number":4750,"title":"Hack Type Checking","user":{"login":"aftabnaveed","id":58515,"avatar_url":"https://avatars.githubusercontent.com/u/58515?v=3","gravatar_id":"","url":"https://api.github.com/users/aftabnaveed","html_url":"https://github.com/aftabnaveed","followers_url":"https://api.github.com/users/aftabnaveed/followers","following_url":"https://api.github.com/users/aftabnaveed/following{/other_user}","gists_url":"https://api.github.com/users/aftabnaveed/gists{/gist_id}","starred_url":"https://api.github.com/users/aftabnaveed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aftabnaveed/subscriptions","organizations_url":"https://api.github.com/users/aftabnaveed/orgs","repos_url":"https://api.github.com/users/aftabnaveed/repos","events_url":"https://api.github.com/users/aftabnaveed/events{/privacy}","received_events_url":"https://api.github.com/users/aftabnaveed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-01T04:15:10Z","updated_at":"2015-02-01T05:05:22Z","closed_at":null,"body":"I am trying to declare a a variable of type \"resource\" (//strict mode) inside a function (local scope)  type hint seems  to not like that,    here is the code snippet followed by Ubound name error\r\n\r\n<code>\r\n    public function accept() : SmtpSocket {  \r\n\r\n        resource $remote;\r\n        $remote = socket_accept($this->_socket);\r\n        if(socket_getpeername($remote, $this->_remoteAddress)) {\r\n            print \"Could not determine remote address...\";\r\n        }\r\n\r\n        print \"Accepted connection from \" . $this->_remoteAddress;\r\n\r\n        return new SmtpSocket($remote);\r\n\r\n    }\r\n</code>\r\n\r\nand Error\r\n\r\nSmtpSocket.hh\", line 51, characters 9-16: Unbound name: resource (Naming[2049])\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/72351885","html_url":"https://github.com/facebook/hhvm/issues/4750#issuecomment-72351885","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4750","id":72351885,"user":{"login":"aftabnaveed","id":58515,"avatar_url":"https://avatars.githubusercontent.com/u/58515?v=3","gravatar_id":"","url":"https://api.github.com/users/aftabnaveed","html_url":"https://github.com/aftabnaveed","followers_url":"https://api.github.com/users/aftabnaveed/followers","following_url":"https://api.github.com/users/aftabnaveed/following{/other_user}","gists_url":"https://api.github.com/users/aftabnaveed/gists{/gist_id}","starred_url":"https://api.github.com/users/aftabnaveed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aftabnaveed/subscriptions","organizations_url":"https://api.github.com/users/aftabnaveed/orgs","repos_url":"https://api.github.com/users/aftabnaveed/repos","events_url":"https://api.github.com/users/aftabnaveed/events{/privacy}","received_events_url":"https://api.github.com/users/aftabnaveed/received_events","type":"User","site_admin":false},"created_at":"2015-02-01T05:05:22Z","updated_at":"2015-02-01T05:05:22Z","body":"I think to have figured it out, but just wanted to confirm if I might have missed some thing here,  we don't need to declare a variable in local scope, but if that is the case then I might assign any thing to it which probably is a bit confusing"}}