Change int types to bool when possible#6148
Closed
kocsismate wants to merge 1 commit intophp:masterfrom
Closed
Conversation
nikic
approved these changes
Sep 16, 2020
Member
nikic
left a comment
There was a problem hiding this comment.
I'm ok with this. Might affect some strict_types code, but I think both of these are sufficiently obscure that working around it is not an undue hassle.
Member
|
I just stumbled upon |
jrfnl
added a commit
to PHPCompatibility/PHPCompatibility
that referenced
this pull request
Oct 2, 2020
…amType` sniff > The `$auto_release` parameter of `sem_get()` was changed to accept bool values > rather than int. > The $flag parameter of ob_implicit_flush() was changed to accept bool > values rather than int. This new sniff will detect hard-coded integer/float values being passed as the affected parameter in the above mentioned functions. The sniff has been set up to allow for more functions / function parameters to be added in the future. Includes unit tests. Refs: * https://github.com/php/php-src/blob/0a84fba0deb1c1b75770a436c4236dc56e6d0463/UPGRADING#L621-L622 * https://github.com/php/php-src/blob/0a84fba0deb1c1b75770a436c4236dc56e6d0463/UPGRADING#L813-L814 * php/php-src#6148 * php/php-src@46d22e4
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
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.
This changes
ob_implicit_flush()andsem_get()to accept aboolinstead of anintwhen the parameter behaves as abool.If it's really possible to make this change, I'll add an UPGRADING entry.