1--TEST--
2proc_open without 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_mb1.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		);
28
29$out = "";
30
31while (!feof($pipes[1])) {
32	$out .= fread($pipes[1], 1024);
33}
34
35proc_close($p);
36
37echo $out;
38
39?>
40==DONE==
41--EXPECTF--
42array(4) {
43  [0]=>
44  string(%d) "%sproc_only_mb1.php"
45  [1]=>
46  string(36) "テストマルチバイト・パス"
47  [2]=>
48  string(6) "füße"
49  [3]=>
50  string(14) "карамба"
51}
52==DONE==
53