#49688 [NEW]: ob_start() does not capture output to STDOUT
From: ch at lathspell dot de
Operating system: Linux
PHP version: 5.3.0
PHP Bug Type: Output Control
Bug description: ob_start() does not capture output to STDOUT
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 bug report at http://bugs.php.net/?id=49688&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49688&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49688&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49688&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49688&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49688&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49688&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49688&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49688&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49688&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49688&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49688&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49688&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49688&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49688&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49688&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49688&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49688&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49688&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49688&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49688&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49688&r=mysqlcfg
Thread (1 message)
- ch at lathspell dot de