-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fix OutputStream for PHP 7.4 #36222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
711c873
to
703266a
Compare
src/Symfony/Component/Console/Tests/Output/StreamOutputTest.php
Outdated
Show resolved
Hide resolved
nicolas-grekas
approved these changes
Mar 26, 2020
chalasr
approved these changes
Mar 26, 2020
fabpot
reviewed
Mar 27, 2020
@@ -70,14 +69,12 @@ public function getStream() | ||
*/ | ||
protected function doWrite($message, $newline) | ||
{ | ||
$message = (string) $message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not related to the fix, I'm going to revert this change while merging the PR.
fabpot
approved these changes
Mar 27, 2020
8f9d015
to
b375f93
Compare
Thank you @guillbdx. |
This was referenced Mar 30, 2020
Merged
Merged
Merged
@HarasimowiczKamil Symfony 4.3 does not receive bugfixes anymore (see https://symfony.com/releases/4.3). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-fwriteActually, 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.