|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-29 10:54 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 13:00:01 2025 UTC |
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) }