8000 bug #36380 [Process] Fixed input/output error on PHP 7.4 (mbardelmeijer) · symfony/symfony@f2d4a29 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f2d4a29

Browse files
bug #36380 [Process] Fixed input/output error on PHP 7.4 (mbardelmeijer)
This PR was merged into the 4.4 branch. Discussion ---------- [Process] Fixed input/output error on PHP 7.4 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34945 | License | MIT | Doc PR | This PR aims to fix the error from #34945, but i'm unsure if this is the best solution. The issue is that on PHP 7.4 the input/output error may come up. php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite > fread() and fwrite() will now return FALSE if the operation failed. Previously an empty string or 0 was returned. EAGAIN/EWOULDBLOCK are not considered failures. These functions now also raise a notice on failure, such as when trying to write to a read only file resource. Commits ------- b98abde Supress error from fread when reading a unix pipe
2 parents 4be98cd + b98abde commit f2d4a29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Process/Pipes/UnixPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function readAndWrite(bool $blocking, bool $close = false): array
118118
$read[$type = array_search($pipe, $this->pipes, true)] = '';
119119

120120
do {
121-
$data = fread($pipe, self::CHUNK_SIZE);
121+
$data = @fread($pipe, self::CHUNK_SIZE);
122122
$read[$type] .= $data;
123123
} while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1])));
124124

0 commit comments

Comments
 (0)
0