1--TEST-- 2proc_open() with invalid pipes 3--FILE-- 4<?php 5 6for ($i = 3; $i<= 5; $i++) { 7 $spec[$i] = array('pipe', 'w'); 8} 9 10$php = getenv("TEST_PHP_EXECUTABLE"); 11$callee = __DIR__ . "/proc_open_pipes_sleep.inc"; 12 13$spec[$i] = array('pi'); 14proc_open("$php -n $callee", $spec, $pipes); 15 16$spec[$i] = 1; 17proc_open("$php -n $callee", $spec, $pipes); 18 19$spec[$i] = array('pipe', "test"); 20proc_open("$php -n $callee", $spec, $pipes); 21var_dump($pipes); 22 23$spec[$i] = array('file', "test", "z"); 24proc_open("$php -n $callee", $spec, $pipes); 25var_dump($pipes); 26 27echo "END\n"; 28?> 29--EXPECTF-- 30Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d 31 32Warning: proc_open(): Descriptor item must be either an array or a File-Handle in %s on line %d 33array(4) { 34 [3]=> 35 resource(%d) of type (Unknown) 36 [4]=> 37 resource(%d) of type (Unknown) 38 [5]=> 39 resource(%d) of type (Unknown) 40 [6]=> 41 resource(%d) of type (Unknown) 42} 43 44Warning: proc_open(test): failed to open stream: %s in %s on line %d 45array(4) { 46 [3]=> 47 resource(%d) of type (Unknown) 48 [4]=> 49 resource(%d) of type (Unknown) 50 [5]=> 51 resource(%d) of type (Unknown) 52 [6]=> 53 resource(%d) of type (Unknown) 54} 55END 56