#49689 [Opn->Bgs]: ob_start() does not capture output to STDOUT

From: Date: Sun, 27 Sep 2009 20:38:45 +0000
Subject: #49689 [Opn->Bgs]: ob_start() does not capture output to STDOUT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142961@lists.php.net to get a copy of this message
ID: 49689 Updated by: felipe@php.net Reported By: chammers at netcologne dot de -Status: Open +Status: Bogus Bug Type: Output Control Operating System: Linux PHP Version: 5.3.0 New Comment: See #49688 Previous Comments: ------------------------------------------------------------------------ [2009-09-27 18:55:47] chammers at netcologne dot de Description: ------------ Output buffering does capture the output of print() and echo() but apparently not anything that goes to STDOUT (php://stdout) via fwrite(). That should preferably be fixed or at least be documented. Reproduce code: --------------- $ cat t.php <?php error_reporting(E_ALL); ob_start(); echo "does work\n"; $f = fopen('php://stdout', 'w'); fwrite($f, "does not work\n"); fclose($f); $v = ob_get_contents(); ob_end_clean(); print("CAPTURED: $v\n"); Expected result: ---------------- $ php t.php CAPTURED: does not work does work Actual result: -------------- $ php t.php does not work CAPTURED: does work ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49689&edit=1

« previous php.bugs (#142961) next »