1--TEST--
2proc_open without bypass_shell subprocess parameter passing
3--SKIPIF--
4<?php
5if (!function_exists("proc_open")) echo "skip proc_open() is not available";
6?>
7--FILE--
8<?php
9
10$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
11
12$f = __DIR__ . DIRECTORY_SEPARATOR . "proc_only_mb1.php";
13$f_escaped = escapeshellarg($f);
14file_put_contents($f,'<?php var_dump($argv); ?>');
15
16$ds = array(
17        0 => array("pipe", "r"),
18        1 => array("pipe", "w"),
19        2 => array("pipe", "w")
20        );
21
22$p = proc_open(
23        "$php -n $f_escaped テストマルチバイト・パス füße карамба",
24        $ds,
25        $pipes
26        );
27
28$out = "";
29
30while (!feof($pipes[1])) {
31    $out .= fread($pipes[1], 1024);
32}
33
34proc_close($p);
35
36echo $out;
37
38?>
39--EXPECTF--
40array(4) {
41  [0]=>
42  string(%d) "%sproc_only_mb1.php"
43  [1]=>
44  string(36) "テストマルチバイト・パス"
45  [2]=>
46  string(6) "füße"
47  [3]=>
48  string(14) "карамба"
49}
50