Bug #71804 [Com]: proc_close does not return exit code
Edit report at https://bugs.php.net/bug.php?id=71804&edit=1
ID: 71804
Comment by: as@php.net
Reported by: mark at mpen dot ca
Summary: proc_close does not return exit code
Status: Open
Type: Bug
Package: Program Execution
Operating System: Ubuntu 14.10
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
Having trouble reproducing. Can you attach strace output for 5.6 and 7? Invoke like:
$ strace -ttt -T -f -s1024 -o strace.log php test.php
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2016-03-11 19:00:30] mark at mpen dot ca
Description:
------------
proc_close always return exit code -1 on PHP 7 when it should be 0 (as it does on PHP 5.6).
$ php7 --version
PHP 7.0.4 (cli) (built: Mar 11 2016 10:54:16) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
Compiled with:
./configure --with-openssl --with-layout=GNU --with-pear --enable-ftp --with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd --enable-session --enable-libxml --enable-xml --with-zlib=yes
--enable-mbstring=all --with-gettext --with-pspell --with-gd --enable-gd-native-ttf
--with-freetype-dir=/usr/local/lib/ --with-jpeg-dir=/usr/local/lib/ --enable-sockets --enable-pcntl
--enable-sigchild --with-mcrypt=/usr/local/lib --enable-posix --enable-dom --enable-simplexml
--with-readline --enable-bcmath
Test script:
---------------
<?php
$proc = proc_open("pwd",[1=>['pipe','w']], $pipes);
var_dump(stream_get_contents($pipes[1]));
fclose($pipes[1]);
var_dump(proc_close($proc));
Expected result:
----------------
Exit code 0
Actual result:
--------------
Exit code -1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71804&edit=1
Thread (7 messages)