Bug #74889 [Ver->Csd]: ob_implicit_flush expects int instead of bool (on boolean value)

From: Date: Tue, 13 Jul 2021 15:15:49 +0000
Subject: Bug #74889 [Ver->Csd]: ob_implicit_flush expects int instead of bool (on boolean value)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235005@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74889&edit=1 ID: 74889 Updated by: cmb@php.net Reported by: love at sickpeople dot se Summary: ob_implicit_flush expects int instead of bool (on boolean value) -Status: Verified +Status: Closed Type: Bug -Package: *General Issues +Package: Output Control PHP Version: 7.2.0alpha3 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: The parameter is bool as of PHP 8.0.0, and that ias also documented. Previous Comments: ------------------------------------------------------------------------ [2017-09-25 23:07:08] cmb@php.net Related To: Bug #75256 ------------------------------------------------------------------------ [2017-08-17 18:38:51] kalle@php.net I kinda agree it doesn't make sense to disallow booleans, when internally the function clearly only ever uses a boolean. What are the most likely thing to do is to allow anything, and then convert them to a boolean value, something like this should probably do: https://gist.github.com/KalleZ/cccb9edc34f492688ddc1dbe8ceaaa22 ------------------------------------------------------------------------ [2017-07-24 21:47:35] spam2 at rhsoft dot net http://php.net/manual/en/function.ob-implicit-flush.php void ob_implicit_flush ([ int $flag = true ] ) *this is* at least a documentation bug becaus eyou CAN NOT pass true to a int param if you arrived in 2017 and using strict types - either the param is bool or the default *can npt* be a bool true and *yes* i was trapped by that too ob_implicit_flush(true); Fatal error: Uncaught TypeError: ob_implicit_flush() expects parameter 1 to be integer, boolean given ------------------------------------------------------------------------ [2017-07-24 21:26:48] michal dot brzuchalski at gmail dot com It's not a bug it's a Feature Request. ------------------------------------------------------------------------ [2017-07-10 04:22:35] love at sickpeople dot se Description: ------------ Note that the documentation states "int" and not "bool". I think "bool" would be more suitable, since the value should be true or false. Test script: --------------- declare(strict_types=1); ob_implicit_flush (true); Expected result: ---------------- No TypeError. Actual result: -------------- TypeError. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74889&edit=1

« previous php.bugs (#235005) next »