ID: 49084 Updated by: j...@php.net Reported By: morrisdavidd at gmail dot com Status: Bogus Bug Type: Streams related Operating System: Linux/Unix PHP Version: 5.3.0 New Comment:
nevermind, I forgot the proc_open params. :) Previous Comments: ------------------------------------------------------------------------ [2009-07-28 21:27:14] morrisdavidd at gmail dot com According to: http://us2.php.net/manual/en/function.proc-open.php ... descriptorspec ... "An array describing the pipe to pass to the process. The first element is the descriptor type and the second element is an option for the given type. Valid types are pipe (the second element is either r to pass the read end of the pipe to the process, or w to pass the write end) " So I open "w" because I want to pass the write end to the process that I've opened so the process can write to it (and I can read from it). On same page, see Example 1: " $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to ); ") ------------------------------------------------------------------------ [2009-07-28 19:45:40] j...@php.net Why do you open the pipe as writable one when you want to read from it..? ------------------------------------------------------------------------ [2009-07-28 06:08:58] morrisdavidd at gmail dot com Actual result is when leaving "badFilter".) ------------------------------------------------------------------------ [2009-07-28 06:07:22] morrisdavidd at gmail dot com Description: ------------ According to: http://us3.php.net/manual/en/function.stream-filter-register.php The return value of PSFS_FEED_ME for the method filter of extended classes of php_user_filter means: "Filter processed successfully, however no data was available to return. More data is required from the stream or prior filter." However, using the return value of PSFS_FEED_ME also inadvertently causes a block on stream read requests that should not be blocked (and an infinite poll for data?). Reproduce code: --------------- bug_demo.php: http://capricorn.physics.fsu.edu/~ddm05/bug_demo.txt test2.php: http://capricorn.physics.fsu.edu/~ddm05/test2.txt Expected result: ---------------- When replacing the phrase "badFilter" with "goodFilter" in line 44: bool(true) Loop! xLoop! xxtest2: 1248760722 Loop! xLoop! xLoop! xLoop! xxtest2: 1248760724 Loop! xLoop! xLoop! xLoop! xxtest2: 1248760726 Loop! ... Actual result: -------------- bool(true) Loop! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49084&edit=1