Repository navigation
Stdlib: ob_flush() / ob_clean() / ob_list_handlers() — missing OB chain builtins (ext/standard/output.c) #4838
Copy link
Copy link
Closed
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web apps
Description
Category
stdlib
Problem
Several output-buffer chain helpers from ext/standard/output.c are still absent. ext/standard/Module.php already registers ob_start, ob_get_contents, ob_get_length, ob_get_level, ob_get_status, ob_end_*, etc. — but ob_flush, ob_clean, and ob_list_handlers are not implemented or registered (function_exists → false).
Frameworks flush nested buffers without ending them; ob_list_handlers() introspects the stack for debugging.
Note: Refresh #3588 — its title mentions ob_get_contents but that builtin is already registered; this issue tracks the remaining three.
php-src reference
- php/php-src
ext/standard/output.c—php_ob_flush,php_ob_clean,php_ob_list_handlers - php/php-src
ext/standard/basic_functions.c— registrations
Repro (failure today)
<?php
ob_start();
echo 'layer1';
ob_start();
echo 'layer2';
var_export(function_exists('ob_flush'));
var_export(function_exists('ob_clean'));
var_export(function_exists('ob_list_handlers'));./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'| Function | Zend | This compiler |
|---|---|---|
ob_flush() |
defined | missing |
ob_clean() |
defined | missing |
ob_list_handlers() |
defined | missing |
Nested flush probe (done-when target):
<?php
ob_start();
echo 'a';
ob_start();
echo 'b';
ob_flush(); // flush inner to parent
echo ob_get_contents(); // parent should contain abScope (this repo)
ext/standard/ob_flush.php,ob_clean.php,ob_list_handlers.php(new)- Wire to existing OB stack (
ext/standard/VmOb.phpor web runtime buffer list) ext/standard/Module.phpregistrationtest/compliance/cases/stdlib/ob_flush_clean_handlers.phpt- JIT: defer (VM-first) — update
docs/capabilities.mdviascript/capability-matrix.php
Done when
- All three functions registered; repro
function_exists→true,true,true - Nested buffer flush/clean semantics match Zend on compliance fixture
-
./script/ci-fast.sh --filter ob_flush_cleangreen
Related
- Umbrella / stale title: Stdlib: ob_flush() / ob_clean() / ob_get_contents() / ob_list_handlers() — output buffer chain (ext/standard/output.c parity) #3588 (fold closed when this lands)
ob_get_statusclosed Stdlib: ob_get_status() — output buffer status array (ext/standard/output.c parity) #3647 ·flush()Stdlib: flush() — flush output buffers to SAPI (ext/standard/output.c parity) #3388
Links
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:vmVirtual machineVirtual machineenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web apps
Activity
PurHur commentedon Jun 3, 2026
Maintainer triage: keeping #4838 as the actionable slice (missing
ob_flush/ob_clean/ob_list_handlers). #3588 title is stale (mentionsob_get_contentswhich is already registered) — fold/close #3588 when #4838 lands.PurHur commentedon Jun 5, 2026
Duplicate of #3588 (same missing ob_flush/ob_clean/ob_list_handlers output-buffer chain). Keeping #3588 as canonical.