Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #36222 [Console] Fix OutputStream for PHP 7.4 (guillbdx)
This PR was squashed before being merged into the 3.4 branch. Discussion ---------- [Console] Fix OutputStream for PHP 7.4 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #36166 | License | MIT From PHP 7.4, `fwrite` function now returns false for any failure: https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite Actually, the note in the PHP documentation is not exact: for PHP 7.3 and lower, `fwrite` function did return false when arguments passed in to the function were invalid, and 0 for other failures. From PHP 7.4, it returns false for any failure. We can see it in the source code: for PHP 7.3: https://github.com/php/php-src/blob/a1a8d144854acb1c891cf0c21abb0f612b1d8de7/ext/standard/file.c#L1140 Compare to PHP 7.4: https://github.com/php/php-src/blob/master/ext/standard/file.c#L1136 I update `OutputStream::doWrite()` to keep the same behavior as before. Commits ------- b375f93 [Console] Fix OutputStream for PHP 7.4
- Loading branch information