php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75256 Default value & proposed values for flag parameter don't match type declaration
Submitted: 2017-09-25 21:02 UTC Modified: 2017-09-25 23:07 UTC
From: hw at hollo dot me Assigned: cmb (profile)
Status: Duplicate Package: Documentation problem
PHP Version: 7.1.9 OS: Ubuntu 16.04. LTS
Private report: No CVE-ID: None
 [2017-09-25 21:02 UTC] hw at hollo dot me
Description:
------------
---
From manual page: http://www.php.net/function.ob-implicit-flush
---

The parameter type declaration of $flag is integer, but its default value is described as TRUE. Additionally the proposed values for $flag are TRUE and FALSE in the documentation.

According to the source https://github.com/php/php-src/blob/c61cea7135f882b9cddef4a7e1a6ce8d51fedd61/main/output.c#L1521 the parameter is defined as an integer.

When using strict_type mode and passing TRUE or FALSE a TypeError is thrown:

--
PHP Fatal error:  Uncaught TypeError: ob_implicit_flush() expects parameter 1 to be integer, boolean given
--

Tested on current PHP 7.0.23 and PHP 7.1.9 in CLI and FPM mode.

Test script:
---------------
<?php declare(strict_types=1);

ob_implicit_flush(true);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-25 21:13 UTC] theseer@php.net
This seems to be more than just a documentation issue and looks almost like a duplicate to https://bugs.php.net/bug.php?id=74889
 [2017-09-25 23:07 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2017-09-25 23:07 UTC] cmb@php.net
Indeed a duplicate of bug #74889.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC