Doc #52180 [Com]: php://input can be read more than once

From: Date: Fri, 25 Jun 2010 06:01:07 +0000
Subject: Doc #52180 [Com]: php://input can be read more than once
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4598@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 Comment by: deceze at gmail dot com Reported by: deceze at gmail dot com Summary: php://input can be read more than once Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [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

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