#50886 [Opn->Csd]: Incomplete documentation for php://memory
| From: | kalle@php.net | Date: | Tue, 16 Feb 2010 07:59:33 +0000 |
| Subject: | #50886 [Opn->Csd]: Incomplete documentation for php://memory | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3902@lists.php.net to get a copy of this message | ||
ID: 50886
Updated by: kalle@php.net
Reported By: nospam at mckenzies dot net
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: any
PHP Version: Irrelevant
New Comment:
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');
Previous Comments:
------------------------------------------------------------------------
[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