Doc #52180 [Opn->Csd]: php://input can be read more than once
| From: | cataphract@php.net | Date: | Wed, 08 Sep 2010 10:53:28 +0000 |
| Subject: | Doc #52180 [Opn->Csd]: php://input can be read more than once | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4997@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52180&edit=1
ID: 52180
Updated by: cataphract@php.net
Reported by: deceze at gmail dot com
Summary: php://input can be read more than once
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cataphract
Block user comment: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-09-08 12:53:01] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=303169
Log: - php://input and how many times it can be read.
- Closes bug #52180
------------------------------------------------------------------------
[2010-06-25 08:01:06] deceze at gmail dot com
Correction: The manual entry seems to be correct regarding PUT requests,
whereas
POST requests can be read many times. Can the documentation be improved
with more
details about what works when?
------------------------------------------------------------------------
[2010-06-25 03:20:19] deceze at gmail dot com
Description:
------------
The input/output streams documentations warns that "Note: php://input
can only be
read once." (http://php.net/manual/en/wrappers.php.php)
This doesn't appear to be correct. php://input can be read once *per
handle*. The
documentation is misleading and should be reworded.
Test script:
---------------
// This will work:
file_get_contents('php://input');
file_get_contents('php://input');
// This won't:
$in = fopen('php://input', 'r');
fread($in, 1024);
fseek($in, 0);
fread($in, 1024);
fclose($in);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52180&edit=1