php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #39120 ob_start chunk_size 0 and 1 are special?
Submitted: 2006-10-10 20:33 UTC Modified: 2007-08-17 15:56 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ceo at l-i-e dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2006-10-10 20:33 UTC] ceo at l-i-e dot com
Description:
------------
User-contributed notes and my own limited experience indicates that 0 and 1 are "special" to the chunk_size in ob_start() and make the callback not behave as documented.

Can this be documented?

Or was it a bug that got fixed?


Reproduce code:
---------------
<?php
  //abuses ob_start callback in CLI to 'tee' output
  //to both buffer and stderr
  function tee($string){
    error_log($string);
    return false;
  }
  ob_start('tee', 0); //fails
  ob_start('tee', 1); //fails
  ob_start('tee', 2); //works!
?>


Expected result:
----------------
0, 1, and 2 should behave the same, or be documented as special.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-17 15:56 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Default value 0 means that the function is called only in the end, other special value 1 sets chunk_size to 4096."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 23:00:03 2025 UTC