php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #24121 ob_start() return value type is invalid
Submitted: 2003-06-11 04:28 UTC Modified: 2003-08-03 19:11 UTC
From: php at alterego dot dp dot ua Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.2 OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at alterego dot dp dot ua
New email:
PHP Version: OS:

 

 [2003-06-11 04:28 UTC] php at alterego dot dp dot ua
Documentation states
void ob_start ( [callback output_callback])

In reality since 4.3.2 this function returns a boolean value. It returns true if output buffering started successfully, and false if some problem occured. This problem can be output callback function that does not exist. Earlier versions of PHP started output buffering with default handler in this case.

Code to show backward incompatibility:
<?
  ob_start();
  echo "AAA";
  $a = ob_get_contents();
  $var = ob_start("thereisnosuchfunction");
  echo "BBB";
  $b = ob_get_contents();
  ob_end_clean();
  ob_end_clean();
  echo $b.'---'.$a;
  var_dump($var);
?>

4.3.2 outputs
AAABBB---AAAbool(false)
earlier versions output
BBB---AAAbool(true)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-03 19:11 UTC] et@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

fixed by derick
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 15 22:00:02 2025 UTC