{"action":"created","issue":{"url":"https://api.github.com/repos/bobthecow/psysh/issues/242","labels_url":"https://api.github.com/repos/bobthecow/psysh/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/bobthecow/psysh/issues/242/comments","events_url":"https://api.github.com/repos/bobthecow/psysh/issues/242/events","html_url":"https://github.com/bobthecow/psysh/issues/242","id":109497749,"number":242,"title":"unset($resource) does not release the resource","user":{"login":"mpyw","id":1351893,"avatar_url":"https://avatars.githubusercontent.com/u/1351893?v=3","gravatar_id":"","url":"https://api.github.com/users/mpyw","html_url":"https://github.com/mpyw","followers_url":"https://api.github.com/users/mpyw/followers","following_url":"https://api.github.com/users/mpyw/following{/other_user}","gists_url":"https://api.github.com/users/mpyw/gists{/gist_id}","starred_url":"https://api.github.com/users/mpyw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpyw/subscriptions","organizations_url":"https://api.github.com/users/mpyw/orgs","repos_url":"https://api.github.com/users/mpyw/repos","events_url":"https://api.github.com/users/mpyw/events{/privacy}","received_events_url":"https://api.github.com/users/mpyw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-02T14:09:10Z","updated_at":"2015-10-02T15:15:06Z","closed_at":null,"body":"PHP Manual says [here](http://php.net/manual/en/language.types.resource.php#language.types.resource.self-destruct)...\r\n\r\n> Thanks to the reference-counting system introduced with PHP 4's Zend Engine, a resource with no more references to it is detected automatically, and it is freed by the garbage collector. For this reason, it is rarely necessary to free the memory manually.\r\n\r\nBoth of the following codes work expectedly. We can safely delete `test.txt`. \r\n\r\n```php\r\n$fp = fopen('test.txt', 'a');\r\nfclose($fp);\r\nwhile (true) { }\r\n```\r\n\r\n```php\r\n$fp = fopen('test.txt', 'a');\r\nunset($fp);\r\nwhile (true) { }\r\n```\r\n\r\nHowever, on PsySH ...\r\n\r\n![d6e399fd-ac01-331f-d8c8-a5704b8472b7](https://cloud.githubusercontent.com/assets/1351893/10248337/cfa24486-6959-11e5-94eb-15f58c4aa61b.png)\r\n\r\nIt seems that PsySH has a bug around the implemention of symbol table..."},"comment":{"url":"https://api.github.com/repos/bobthecow/psysh/issues/comments/145057695","html_url":"https://github.com/bobthecow/psysh/issues/242#issuecomment-145057695","issue_url":"https://api.github.com/repos/bobthecow/psysh/issues/242","id":145057695,"user":{"login":"mpyw","id":1351893,"avatar_url":"https://avatars.githubusercontent.com/u/1351893?v=3","gravatar_id":"","url":"https://api.github.com/users/mpyw","html_url":"https://github.com/mpyw","followers_url":"https://api.github.com/users/mpyw/followers","following_url":"https://api.github.com/users/mpyw/following{/other_user}","gists_url":"https://api.github.com/users/mpyw/gists{/gist_id}","starred_url":"https://api.github.com/users/mpyw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpyw/subscriptions","organizations_url":"https://api.github.com/users/mpyw/orgs","repos_url":"https://api.github.com/users/mpyw/repos","events_url":"https://api.github.com/users/mpyw/events{/privacy}","received_events_url":"https://api.github.com/users/mpyw/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T15:15:06Z","updated_at":"2015-10-02T15:15:06Z","body":"> Due to the way the internals work.\r\n\r\nYes, PsySH seems to have powerful features for reflection. Even so, all variables (and resources) related to `$fp` should be completely released after `unset($fp)`."}}