Bug #74346 [Com]: proc_open reference to return value

From: Date: Thu, 30 Mar 2017 23:24:38 +0000
Subject: Bug #74346 [Com]: proc_open reference to return value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208205@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74346&edit=1 ID: 74346 Comment by: marco dot agnoli at me dot com Reported by: marco dot agnoli at me dot com Summary: proc_open reference to return value Status: Open Type: Bug Package: Program Execution Operating System: OS X 10.11.6 PHP Version: 5.6.30 Block user comment: N Private report: N New Comment: Just realized that I passed the second parameter ($descriptorspec) wrong. Still shows the same behaviour though. Previous Comments: ------------------------------------------------------------------------ [2017-03-30 23:11:10] marco dot agnoli at me dot com Made a typo: * proc_close (NOT proc_open) returns immediately when a reference to the returned resource is made. ------------------------------------------------------------------------ [2017-03-30 23:09:24] marco dot agnoli at me dot com Description: ------------ proc_open returns immediately when a reference to the returned resource is made. PHP 7.x shows the expected behaviour. Test script: --------------- <?php $spec = [ 0 => STDIN, 1 => STDOUT, 2 => STDERR ]; $pipes = []; echo 'Starting'.PHP_EOL; $proc = proc_open('sleep 3 ; echo "Hi"', $spec, $pipes); if (!is_resource($proc)) exit(1); $ref = &$proc; // Should wait but does not wait proc_close($proc); echo 'Done'.PHP_EOL; Expected result: ---------------- Starting Hi (after 3 seconds) Done Actual result: -------------- Starting Done Hi (after 3 seconds) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74346&edit=1

« previous php.bugs (#208205) next »