2); VS(proc_close($process), 0); $descriptorspec = array(array("pipe", "r"), array("pipe", "w"), array("file", $errout, "a")); $cwd = "/tmp"; $process = proc_open("sh", $descriptorspec, $pipes, $cwd); VERIFY($process != false); fprintf($pipes[0], "echo Sup"); fclose($pipes[0]); fpassthru($pipes[1]); VS(proc_close($process), 0); $descriptorspec = array(array("pipe", "r"), array("pipe", "w"), array("file", $errout, "a")); $process = proc_open('cat', $descriptorspec, $pipes); VERIFY($process != false); VERIFY(proc_terminate($process)); // still need to close it, not to leave a zombie behind proc_close($process); $process = proc_open('cat', $descriptorspec, $pipes); VERIFY($process != false); $ret = proc_get_status($process); VS($ret['command'], 'cat'); VERIFY($ret['pid'] > 0); VERIFY($ret['running']); VERIFY(!$ret['signaled']); VS($ret['exitcode'], -1); VS($ret['termsig'], 0); VS($ret['stopsig'], 0); proc_close($process); VERIFY(proc_nice(0)); VS(escapeshellarg("\""), "'\"'"); VS(escapeshellcmd("perl \""), "perl \\\"");