php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50886 Incomplete documentation for php://memory
Submitted: 2010-01-30 16:56 UTC Modified: 2016-06-25 14:29 UTC
From: nospam at mckenzies dot net Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
 [2010-01-30 16:56 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-30 17:01 UTC] nospam at mckenzies dot net
The documentation referred to is: http://us3.php.net/manual/en/wrappers.php.php
 [2010-02-16 07:59 UTC] 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-02-22 04:11 UTC] nospam at mckenzies dot net
Thta's what I figured.  Could someone add that to the docs?
 [2015-12-09 13:37 UTC] cweiske@php.net
-Status: Closed +Status: Re-Opened
 [2016-06-25 14:29 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339489
Log: Fix #50886: Incomplete documentation for php://memory
 [2016-06-25 14:29 UTC] cmb@php.net
-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-06-25 14:29 UTC] cmb@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.
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=f8aa32180b9ac02e891d050c22f656e884f0bb18
Log: Fix #50886: Incomplete documentation for php://memory
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC