|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-08 08:22 UTC] jani@php.net
[2008-04-08 09:47 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 05:00:01 2025 UTC |
Description: ------------ proc_open.c checks if the mode parameter != "w" instead of checking the first character of the mode parameter. This prevents the mode 'wb' from working properly. Reproduce code: --------------- <?php $pipes = array(); $descriptor_spec = array( 0 => array('pipe', 'rb'), 1 => array('pipe', 'wb'), ); $proc = proc_open('cat', $descriptor_spec, $pipes); fwrite($pipes[0], 'Hello', 5); fflush($pipes[0]); fclose($pipes[0]); $result = fread($pipes[1], 5); fclose($pipes[1]); proc_close($proc); echo "Result is: ", $result, "\n"; ?> Expected result: ---------------- Result is: Hello Actual result: -------------- on stderr: cat: write error: Bad file descriptor on stdout: Result is: