1--TEST--
2proc_open with bypass_shell subprocess parameter passing
3--SKIPIF--
4<?php
5if (php_sapi_name() != "cli") die('skip CLI only test');
6if (!function_exists("proc_open")) echo "skip proc_open() is not available";
7?>
8--FILE--
9<?php
10
11$php = PHP_BINARY;
12
13$f = __DIR__ . DIRECTORY_SEPARATOR . "proc_only_mb0.php";
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 テストマルチバイト・パス füße карамба",
24		$ds,
25		$pipes,
26		NULL,
27		NULL,
28		array("bypass_shell" => true)
29		);
30
31$out = "";
32
33while (!feof($pipes[1])) {
34	$out .= fread($pipes[1], 1024);
35}
36
37proc_close($p);
38
39echo $out;
40
41?>
42==DONE==
43--EXPECTF--
44array(4) {
45  [0]=>
46  string(%d) "%sproc_only_mb0.php"
47  [1]=>
48  string(36) "テストマルチバイト・パス"
49  [2]=>
50  string(6) "füße"
51  [3]=>
52  string(14) "карамба"
53}
54==DONE==
55