2013/1/31 Chris Wright <chr...@aquacool.ltd.uk> > > I propose the following syntax: > > > > php://memory/<id> > > php://temp/<id>/maxmemory:<size> > > I would very much like to see this as well. > > Would this also allow you to open multiple pointers to the same bucket? > > For example would this work? > > <?php > > $fp = fopen('php://memory/foo', 'w+'); > > file_put_contents('php://memory/foo', 'data'); > > rewind($fp); // would this be necessary? > > echo stream_get_contents($fp); // outputs 'data' >
Everything else wouldn't make much sense, because why else should you need to define an id for it? Bu whats about file_put_contents('php://memory/foo', 'data'); $fp = fopen('php://memory/foo', 'w+'); 'file_put_contents()' closes the stream after writing. I would expect, that the engine will cleanup the memory (at least sooner or later), but then I open it again. Additional why don't you just pass the open stream around, if you need to access it at multiple places? Regards, Sebastian > > Best regards > Chris Wright > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch