#50886 [Csd]: Incomplete documentation for php://memory
| From: | nospam at mckenzies dot net | Date: | Mon, 22 Feb 2010 04:11:03 +0000 |
| Subject: | #50886 [Csd]: Incomplete documentation for php://memory | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3953@lists.php.net to get a copy of this message | ||
ID: 50886
User updated by: nospam at mckenzies dot net
Reported By: nospam at mckenzies dot net
Status: Closed
Bug Type: Documentation problem
Operating System: any
PHP Version: Irrelevant
New Comment:
Thta's what I figured. Could someone add that to the docs?
Previous Comments:
------------------------------------------------------------------------
[2010-02-16 07:59:33] kalle@php.net
Yes it only works for streams. You cannot store data in php://memory,
and later use it in another stream:
This will not work, because after file_put_contents() the stream will
be closed and the data in php://memory will be lost:
file_put_contents('php://memory', 'PHP');
echo file_get_contents('php://memory');
------------------------------------------------------------------------
[2010-01-30 17:01:21] nospam at mckenzies dot net
The documentation referred to is:
http://us3.php.net/manual/en/wrappers.php.php
------------------------------------------------------------------------
[2010-01-30 16:56:06] nospam at mckenzies dot net
Description:
------------
The documentation for php://memory is incomplete. There is no example
and there is no mention of what functions support the use of
php://memory. Does it only work with streams?
Reproduce code:
---------------
$text = 'Some text.';
file_put_contents('php://memory', $text);
echo file_get_contents('php://memory');
Expected result:
----------------
Some text.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50886&edit=1