[RFC] Improve compatibility with legacy versions#29
Conversation
|
Rebased now that #27 is in |
|
Rebased now that #26 is in |
|
Test are segfaulting on 5.3 it seems |
|
I've traced down the SEGFAULT on legacy PHP < 5.4 to this gist: $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 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 |
|
TL;DR: Updated to fix all issues |
Because why not… :-)
Now more seriously: This project is a low level lib that is used as a building block for quite a few higher level abstractions on top of it. As such, compatibility (even with significantly outdated versions) is a major concern to me.
Note that I'm not suggesting putting significant amount of work into this. The patch is already here and, personally, I see little harm in supporting this.
Also note that I'm not suggesting we need to keep support indefinitely. Should this ever turn out to be a burden in the future, e.g. because we actually require any new language features or some external lib, then I'm all for dropping support again.