ID: 39982 Updated by: [EMAIL PROTECTED] Reported By: federico at galassi dot net -Status: Open +Status: Bogus Bug Type: Program Execution Operating System: gentoo linux PHP Version: 5.2.0 New Comment:
The $pipes are dependant resources of the $proc, so if $proc dies, they are closed too. Return both $proc and $pipes and everything will be ok. Previous Comments: ------------------------------------------------------------------------ [2006-12-29 01:13:24] federico at galassi dot net Description: ------------ When calling proc_open inside the body of a function, pipes generated don't survive function's lifespan. resource is still there but stream is closed. Reproduce code: --------------- function foobar() { $proc = proc_open( "/usr/bin/php", array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w') ), $pipes ); var_dump($pipes); return $pipes; } $should_be_pipes = foobar(); var_dump($should_be_pipes); Expected result: ---------------- array(3) { [0]=> resource(6) of type (stream) [1]=> resource(7) of type (stream) [2]=> resource(8) of type (stream) } array(3) { [0]=> resource(6) of type (stream) [1]=> resource(7) of type (stream) [2]=> resource(8) of type (stream) } Actual result: -------------- array(3) { [0]=> resource(6) of type (stream) [1]=> resource(7) of type (stream) [2]=> resource(8) of type (stream) } array(3) { [0]=> resource(6) of type (Unknown) [1]=> resource(7) of type (Unknown) [2]=> resource(8) of type (Unknown) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39982&edit=1