Bug #63922 [Opn->Wfx]: stream_select on pipes returned by proc_open returns streams that are not ready
| From: | ab@php.net | Date: | Mon, 29 Sep 2014 14:49:01 +0000 |
| Subject: | Bug #63922 [Opn->Wfx]: stream_select on pipes returned by proc_open returns streams that are not ready | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187751@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63922&edit=1
ID: 63922
Updated by: ab@php.net
Reported by: LastDragon at yandex dot ru
Summary: stream_select on pipes returned by proc_open returns
streams that are not ready
-Status: Open
+Status: Wont fix
Type: Bug
Package: Streams related
Operating System: Windows
PHP Version: 5.4.10
Block user comment: N
Private report: N
New Comment:
see bug #47918
Previous Comments:
------------------------------------------------------------------------
[2014-09-29 14:47:50] ab@php.net
Related To: Bug #47918
------------------------------------------------------------------------
[2013-05-03 11:03:52] ab@php.net
Related To: Bug #64770
------------------------------------------------------------------------
[2013-01-06 18:16:28] LastDragon at yandex dot ru
Description:
------------
This is https://bugs.php.net/bug.php?id=44908
that is still exists... ~5 years :'(
> When using stream_select() on pipes returned by proc_open() in Windows, input streams that are
> not ready are returned in the modified $read array.
Test script:
---------------
<?php
// stream_select.php
$cmd = "php stream_select.process.php";
$pipes = array();
$descriptors = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w"), // stderr
);
$process = proc_open($cmd, $descriptors, $pipes);
if (is_resource($process)) {
$read = [$pipes[1], $pipes[2]];
$write = null;
$except = null;
$changed = stream_select($read, $write, $except, null);
var_dump($changed, $read, $write);
}
// stream_select.process.php
<?php
fwrite(STDOUT, 'test');
fflush(STDOUT);
sleep(15);
exit(0);
Expected result:
----------------
int(1)
array(1) {
[0]=>
resource(5) of type (stream)
}
NULL
Actual result:
--------------
int(2)
array(2) {
[0]=>
resource(5) of type (stream)
[1]=>
resource(6) of type (stream)
}
NULL
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63922&edit=1