Skip to content

Regression: system()/passthru() child stdout not captured in active output buffer (ext/standard/exec.c) #13251

Description

@PurHur

Category

stdlib · php-src-strict · regression · refs #1492

Problem

When an output buffer is active (ob_start()), Zend system() and passthru() echo child process stdout into that buffer and return the last line (system() only). This compiler returns the last line for system() but leaves the active buffer empty; passthru() buffer is also empty.

Verified 2026-06-28 — repro prints system_ob_ok=1 / passthru_ob_ok=1 on Zend vs 0 on VM.

php-src reference

Repro

test/repro/maintainer_gap_system_passthru_ob.php

php test/repro/maintainer_gap_system_passthru_ob.php
php bin/vm.php test/repro/maintainer_gap_system_passthru_ob.php

Implementation hints (PHP-in-PHP)

Done when

  • Repro: system_ob_ok=1 and passthru_ob_ok=1 on VM
  • No regression for unbuffered CLI stdout
  • Targeted PHPUnit/compliance guard

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions