1--TEST-- 2proc_open without 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_mb1.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 ); 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==DONE== 40--EXPECTF-- 41array(4) { 42 [0]=> 43 string(%d) "%sproc_only_mb1.php" 44 [1]=> 45 string(36) "テストマルチバイト・パス" 46 [2]=> 47 string(6) "füße" 48 [3]=> 49 string(14) "карамба" 50} 51==DONE== 52