We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7783ed9 commit 11eb9fbCopy full SHA for 11eb9fb
ext/standard/tests/file/bug60120.phpt
@@ -61,18 +61,19 @@ while ($pipes || $writePipes) {
61
foreach ($r as $pipe) {
62
$type = array_search($pipe, $pipes);
63
$data = fread($pipe, 8192);
64
- if (false === $data || feof($pipe)) {
+ if (feof($pipe)) {
65
fclose($pipe);
66
unset($pipes[$type]);
67
+ } elseif (false === $data) {
68
+ die('Failed to read from pipe');
69
} else {
- $resourceId = get_resource_id($pipe);
- $procOutput[$resourceId] = ($procOutput[$resourceId] ?? '') . $data;
70
+ $procOutput[$type] = ($procOutput[$type] ?? '') . $data;
71
}
72
73
74
foreach ($procOutput as $output) {
75
if ($output !== $stdin) {
- die('Output does not match input');
76
+ die('Output does not match input: ' . $output);
77
78
79
echo "OK.";
0 commit comments