Bug #60131 [NEW]: fopen('php://stdout'...) redirect all posterious echo to /dev/null

From: Date: Tue, 25 Oct 2011 14:24:53 +0000
Subject: Bug #60131 [NEW]: fopen('php://stdout'...) redirect all posterious echo to /dev/null
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-164556@lists.php.net to get a copy of this message
From: Operating system: Mac OS Snow Leopard PHP version: 5.3.8 Package: Streams related Bug Type: Bug Bug description:fopen('php://stdout'...) redirect all posterious echo to /dev/null Description: ------------ If fopen('php://stdout', ...) is used in a php processus open with proc_open(), all posterious call to echo or print seems to be redirected to /dev/null. Test script: --------------- <?php $descriptors = array( 0 => array("pipe", "r"), 1 => array("pipe", "w") ); $php = proc_open('php', $descriptors, $pipes); stream_set_blocking($pipes[1], 0); fwrite($pipes[0], '<?php echo \'foo\'; fopen(\'php://stdout\', \'w\'); echo \'bar\'; ?>'); fclose($pipes[0]); $null = null; $select = array($pipes[1]); while (feof($pipes[1]) === false) { if (stream_select($select, $null, $null, null)) { var_dump(stream_get_contents($pipes[1])); } } Expected result: ---------------- foobar Actual result: -------------- foo -- Edit bug report at https://bugs.php.net/bug.php?id=60131&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60131&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60131&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60131&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60131&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60131&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60131&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60131&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60131&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60131&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60131&r=support Expected behavior: https://bugs.php.net/fix.php?id=60131&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60131&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60131&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60131&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60131&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60131&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60131&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60131&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60131&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60131&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60131&r=mysqlcfg

« previous php.bugs (#164556) next »