Bug #74346 [Opn->Wfx]: proc_open reference to return value

From: Date: Fri, 10 Aug 2018 15:55:05 +0000
Subject: Bug #74346 [Opn->Wfx]: proc_open reference to return value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216711@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 Updated by: cmb@php.net Reported by: marco dot agnoli at me dot com Summary: proc_open reference to return value -Status: Open +Status: Wont fix Type: Bug Package: Program Execution Operating System: OS X 10.11.6 PHP Version: 5.6.30 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Active support for PHP 5.6 ended on 19 Jan 2017[1], so this won't be fixed. [1] <http://php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2017-03-30 23:24:38] marco dot agnoli at me dot com Just realized that I passed the second parameter ($descriptorspec) wrong. Still shows the same behaviour though. ------------------------------------------------------------------------ [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 (#216711) next »