{"action":"opened","issue":{"url":"https://api.github.com/repos/guzzle/guzzle/issues/1619","repository_url":"https://api.github.com/repos/guzzle/guzzle","labels_url":"https://api.github.com/repos/guzzle/guzzle/issues/1619/labels{/name}","comments_url":"https://api.github.com/repos/guzzle/guzzle/issues/1619/comments","events_url":"https://api.github.com/repos/guzzle/guzzle/issues/1619/events","html_url":"https://github.com/guzzle/guzzle/issues/1619","id":183577803,"number":1619,"title":"Stream's eof() function does not return correct result.","user":{"login":"katmsft","id":21050104,"avatar_url":"https://avatars.githubusercontent.com/u/21050104?v=3","gravatar_id":"","url":"https://api.github.com/users/katmsft","html_url":"https://github.com/katmsft","followers_url":"https://api.github.com/users/katmsft/followers","following_url":"https://api.github.com/users/katmsft/following{/other_user}","gists_url":"https://api.github.com/users/katmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/katmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katmsft/subscriptions","organizations_url":"https://api.github.com/users/katmsft/orgs","repos_url":"https://api.github.com/users/katmsft/repos","events_url":"https://api.github.com/users/katmsft/events{/privacy}","received_events_url":"https://api.github.com/users/katmsft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-18T02:53:47Z","updated_at":"2016-10-18T02:53:47Z","closed_at":null,"body":"Hi, currently during development I found that the `eof()` method of StreamInterface does not work properly. I do not know if it is me who misunderstood the behavior or there is a bug regarding this issue. The code of me testing the case is like this.\r\n```\r\n$resource = fread('test.txt');//Any test txt file. Better not too large.\r\n$content = Psr7\\stream_for($resource);\r\n$size = $content->getSize();\r\n$content->read($size);//Read exactly the size of the file.\r\n$isEof = $content->eof() == true? 'is end of file' : 'not end of file';\r\necho \"{$size}\\n{$isEof}\\n\";//Print the size of the file. Result also show 'not end of file';\r\n```\r\nIf I get the remaining contents of the file using `getContents` or `read($length)` afterwards it returns an empty string, and then can have `eof()` returning the correct result."}}
{"actor":{"display_login":"katmsft"}}