|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72804 docs on rewind explicitly says it must be opened by fopen()
Submitted: 2016-08-10 13:25 UTC Modified: 2021-09-13 14:14 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: divinity76 at gmail dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: divinity76 at gmail dot com
New email:
PHP Version: OS:


 [2016-08-10 13:25 UTC] divinity76 at gmail dot com
From manual page:
quote: The file pointer must be valid, and must point to a file successfully opened by fopen().

rewind also works fine on files opened by tmpfile(), so at the very least, the docs should say "opened by fopen() or tmpfile()", if there isn't more. (PS: there is a similar problem with the docs for "ftell")

Test script:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-10 21:13 UTC]
-Package: Documentation problem +Package: Filesystem function related
 [2016-08-10 21:13 UTC]
It works on all streams (that support seeking).

fclose, feof, fflush... It looks like most of the functions specifically call out fopen or fsockopen. Given how prevalent streams are, could they warrant their own pseudotype in the manual?
 [2021-07-29 10:57 UTC]
Hmm, we just got rid of all pseudo types in the manual, and given
that resources are considered obsolete and a lot of work has
already been done to convert many of them to objects, I don't
think that introducing a pseudo type for streams makes much sense
at this point.
 [2021-08-03 14:04 UTC] test at test dot test
@cmb the Iterable pseudo-type is still in the manual, quoting Iterable is a pseudo-type introduced in PHP 7.1.
 [2021-09-13 14:14 UTC]
> the Iterable pseudo-type is still in the manual

Ah, good catch!  Iterable is, however, not a pseudo-type, but
rather a real type, see <> (it is not an
interface, though).  The docs need to be fixed in that regard.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 10:03:36 2021 UTC