Doc #72804 [Com]: docs on rewind explicitly says it must be opened by fopen()
| From: | test at test dot test | Date: | Tue, 03 Aug 2021 14:04:09 +0000 |
| Subject: | Doc #72804 [Com]: docs on rewind explicitly says it must be opened by fopen() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-19030@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72804&edit=1
ID: 72804
Comment by: test at test dot test
Reported by: divinity76 at gmail dot com
Summary: docs on rewind explicitly says it must be opened by
fopen()
Status: Open
Type: Documentation Problem
Package: Filesystem function related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
@cmb the Iterable pseudo-type is still in the manual, quoting https://www.php.net/manual/en/language.types.iterable.php:
Iterable is a pseudo-type introduced in PHP 7.1.
Previous Comments:
------------------------------------------------------------------------
[2021-07-29 10:57:52] cmb@php.net
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.
------------------------------------------------------------------------
[2016-08-10 21:13:47] requinix@php.net
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?
------------------------------------------------------------------------
[2016-08-10 13:25:24] divinity76 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.rewind
---
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:
---------------
<?php
$h=tmpfile();
var_dump(ftell($h));
fwrite($h,'PHP');
var_dump(ftell($h));
rewind($h);
var_dump(ftell($h));
Expected result:
----------------
int(0)
int(3)
int(3)
Actual result:
--------------
int(0)
int(3)
int(0)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72804&edit=1