Skip to content

Conversation

@kocsismate
Copy link
Member

This changes ob_implicit_flush() and sem_get() to accept a bool instead of an int when the parameter behaves as a bool.

If it's really possible to make this change, I'll add an UPGRADING entry.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cmb69
Copy link
Member

cmb69 commented Sep 16, 2020

I just stumbled upon ob_implicit_flush() the other day, and at first thought the docs needed to be fixed. So yes, +1 from me.

@php-pulls php-pulls closed this in 46d22e4 Sep 17, 2020
@kocsismate kocsismate deleted the int-to-bool branch September 17, 2020 07:40
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants