1--TEST--
2proc_open with bypass_shell subprocess parameter passing
3--SKIPIF--
4<?php # vim:syn=php
5if (substr(PHP_OS, 0, 3) != 'WIN') die("skip Valid only on Windows");
6if (php_sapi_name() != "cli") die('skip CLI only test');
7if (!function_exists("proc_open")) echo "skip proc_open() is not available";
8?>
9--FILE--
10<?php
11
12$php = PHP_BINARY;
13
14$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_only_mb0.php";
15file_put_contents($f,'<?php var_dump($argv); ?>');
16
17$ds = array(
18		0 => array("pipe", "r"),
19		1 => array("pipe", "w"),
20		2 => array("pipe", "w")
21		);
22
23$p = proc_open(
24		"$php -n $f テストマルチバイト・パス füße карамба",
25		$ds,
26		$pipes,
27		NULL,
28		NULL,
29		array("bypass_shell" => true)
30		);
31
32$out = "";
33
34while (!feof($pipes[1])) {
35	$out .= fread($pipes[1], 1024);
36}
37
38proc_close($p);
39
40echo $out;
41
42?>
43==DONE==
44--EXPECTF--
45array(4) {
46  [0]=>
47  string(%d) "%sproc_only_mb0.php"
48  [1]=>
49  string(36) "テストマルチバイト・パス"
50  [2]=>
51  string(6) "füße"
52  [3]=>
53  string(14) "карамба"
54}
55==DONE==
56