tested it now and it works when used like this:

```php
$data = str_repeat('lalaaaa', 5000);

$stream = fopen('php://memory','r+');
stream_filter_append($stream, 'convert.base64-encode', STREAM_FILTER_WRITE);
fwrite($stream, $data);
rewind($stream);

var_dump(stream_get_contents($stream));
```

I measured memory consumption with the teststring `$data = str_repeat('lalaaaa', 5000);` and it seems that using the in-memory stream consumes even more memory - I think mainly because of the buffer not beeing free'd yet.

To put it into a nutshell: atm there is no benefit when using streams here. I would leave it as is, until someone encounters the problem of insufficient memory and then one could reconsider using a tempfile for this to cut memory consumption by ~75%