php / php/doc-en

ob_start chunk_size 0/1 behave differently than any other value <4096

Open
#3,815 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Description

https://3v4l.org/fHmH7

The following code:

<?php

function my_cb( $a ) {
    return $a;
}

ob_start( 'my_cb', 0 );
ob_start( 'my_cb', 1 );
ob_start( 'my_cb', 2 );

$status = ob_get_status( true );
var_dump( array_combine( array_column( $status, 'chunk_size' ), array_column( $status, 'buffer_size' ) ) );

Resulted in this output:

array(3) {
  [0]=>
  int(16384)
  [1]=>
  int(16384)
  [2]=>
  int(4096)
}

But I expected this output instead:

array(3) {
  [0]=>
  int(4096)
  [1]=>
  int(4096)
  [2]=>
  int(4096)
}
PHP Version

8.3.x

Operating System

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PHP documentation for ob_start() and ob_get_status(), then reproduce the linked 3v4l.org example on PHP 8.3. Compare the documented chunk_size and buffer_size behavior for values 0, 1, 2, and other values below 4096. Done means the relevant documentation explains the observed behavior or records a confirmed correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.