PHP  
 PHP_5_3
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/standard/tests/streams/bug64770.phpt ('Bug #64770 stream_select() fails with pipes from proc_open()')

Script

1: <?php
2:
3: $descs 
= array(
4:     
=> array('pipe''r'), // stdin
5:     
=> array('pipe''w'), // stdout
6:     
=> array('pipe''w'), // strerr
7:
);
8:
9:
$other_opts = array('suppress_errors' => false'binary_pipes' => true);
10:
11:
$cmd = (substr(PHP_OS03) == 'WIN') ? 'dir' 'ls';
12:
$p proc_open($cmd$descs$pipes'.'NULL$other_opts);
13:
14: if (
is_resource($p)) {
15:     
$data '';
16:
17:     while (
1) {    
18:         
$w $e NULL;
19:         
$n stream_select($pipes$w$e300);
20:
21:         if (
$n === false) {
22:             echo 
"no streams \n";
23:             break;
24:         } else if (
$n === 0) {
25:             echo 
"process timed out\n";
26:             
proc_terminate($p9);
27:             break;
28:         } else if (
$n 0) {
29:             
$line fread($pipes[1], 8192);
30:             if (
strlen($line) == 0) {
31:                 
/* EOF */
32:                 
break;
33:             }
34:             
$data .= $line;
35:         }
36:     }
37:     
var_dump(strlen($data));
38:
39:     
$ret proc_close($p);
40:     
var_dump($ret);
41: } else {
42:     echo 
"no process\n";
43: }
44:
?>
45:
==DONE==
46:

Expected

int(%d)
int(0)
==DONE==

Output

Notice: Undefined offset: 1 in /var/php_gcov/PHP_5_3/ext/standard/tests/streams/bug64770.php on line 29

Warning: fread() expects parameter 1 to be resource, null given in /var/php_gcov/PHP_5_3/ext/standard/tests/streams/bug64770.php on line 29
int(0)
int(0)
==DONE==

Diff

001+ Notice: Undefined offset: 1 in /var/php_gcov/PHP_5_3/ext/standard/tests/streams/bug64770.php on line 29
002+ 
003+ Warning: fread() expects parameter 1 to be resource, null given in /var/php_gcov/PHP_5_3/ext/standard/tests/streams/bug64770.php on line 29

 

Generated at Sun, 27 Jul 2014 12:58:43 +0000 (3 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.