Doc #72804 [Opn]: docs on rewind explicitly says it must be opened by fopen()

From: Date: Wed, 10 Aug 2016 21:13:47 +0000
Subject: Doc #72804 [Opn]: 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-13801@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 Updated by: requinix@php.net 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: Documentation problem +Package: Filesystem function related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#13801) next »