|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-27 20:38 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
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