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