On Thu, 31 Jan 2013 10:37:53 +0100, Ivan Enderlin @ Hoa
<ivan.ender...@hoa-project.net> wrote:
The php://memory, and its respectful sibling php://temp, appear very
useful when we need to compute streams on-the-fly. They offer a lot of
services, like avoiding HDD accesses, increasing speed... and through a
straightforward API /à la/ PHP, e.g. fopen('php://memory', 'r+').
However, we always work on the same "bucket"/space of data (per
runtime), which prevent us to use two different streams at a time. My
proposal is to allow access to many "buckets"/spaces to php://memory and
its sibling.
I'm not sure what you mean here. Each time you open a php://memory stream,
you're working on a new "bucket", right?
$ cat a.php && php a.php
<?php
$f1 = fopen("php://memory", "r+");
$f2 = fopen("php://memory", "r+");
fwrite($f1, "foobar");
array_map(function($f) {
rewind($f);
var_dump(stream_get_contents($f));
}, [$f1, $f2]);
string(6) "foobar"
string(0) ""
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php