php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52180 php://input can be read more than once
Submitted: 2010-06-25 03:20 UTC Modified: 2010-09-08 12:53 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: deceze at gmail dot com Assigned: cataphract (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: deceze at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-25 03:20 UTC] 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);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-25 08:01 UTC] 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-09-08 12:53 UTC] 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-09-08 12:53 UTC] cataphract@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cataphract
 [2010-09-08 12:53 UTC] cataphract@php.net
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.


 [2023-01-22 16:07 UTC] imjohneric at mail dot com
Thanks for the help. useful.
(https://txtaghelp.com).github.com
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 13:00:02 2026 UTC