On Thu, 31 Jan 2013 14:55:26 +0100, Ivan Enderlin @ Hoa
<ivan.ender...@hoa-project.net> wrote:
I'm not sure what you mean here. Each time you open a php://memory
stream, you're working on a new "bucket", right?
Yes exact. My bad. But my proposal still persist. Identifying
php://memory buckets would be nice to retrieve them. For example:
$f1 = fopen('php://memory/foo', 'r+');
fwrite($f1, 'foobar');
unset($f1);
$f1prime = fopen('php://memory/foo', 'r+');
rewind($f1);
var_dump(stream_get_contents($f1)); // string(6) "foobar"
Is it interesting? In this way, we have a similar behavior than
php://fd/<i>, file://, http:// etc.
No. When you do unset($f1), you're closing the file and the memory is
reclaimed. That's how it's supposed to be.
Just pass the stream along. If you really need to use operations on the
URLs themselves, you can easily write a user wrapper that delegates to
static php://memory streams kept statically.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php