$s = popen('echo test', 'r'); stream_set_blocking($s, 0); stream_set_read_buffer($s, 0); $data = stream_get_contents($s, 8000); var_dump($data);
Apparently, this reads beyond the resource limits and returns a corrupted string value where strlen($data) === -1.
I've added a very simple workaround to re-enable stream buffers on affected versions only and I have yet to observe any side effects. In other words: This fixed version works without known limitations currently.
As it turns out, this is actually an issue in the underlying stream component for ALL pipes and is not limited to process pipes. The very same issue can also be reproduced by using $s = STDIN; in the above example. This has been introduced as a side-effect of reactphp/stream#20. I'll make sure to file an issue in the stream component for this and link back here.