|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74889 ob_implicit_flush expects int instead of bool (on boolean value)
Submitted: 2017-07-10 04:22 UTC Modified: 2021-07-13 15:15 UTC
From: love at sickpeople dot se Assigned: cmb (profile)
Status: Closed Package: Output Control
PHP Version: 7.2.0alpha3 OS:
Private report: No CVE-ID: None
 [2017-07-10 04:22 UTC] love at sickpeople dot se
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:

ob_implicit_flush (true);

Expected result:
No TypeError.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-24 21:26 UTC] michal dot brzuchalski at gmail dot com
It's not a bug it's a Feature Request.
 [2017-07-24 21:47 UTC] spam2 at rhsoft dot net
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


Fatal error: Uncaught TypeError: ob_implicit_flush() expects parameter 1 to be integer, boolean given
 [2017-08-17 18:38 UTC]
-Status: Open +Status: Verified
 [2017-08-17 18:38 UTC]
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:
 [2021-07-13 15:15 UTC]
-Status: Verified +Status: Closed -Package: *General Issues +Package: Output Control -Assigned To: +Assigned To: cmb
 [2021-07-13 15:15 UTC]
The parameter is bool as of PHP 8.0.0, and that ias also
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 23:01:29 2024 UTC