php-src/ext/standard/tests/general_functions/proc_open.phpt
Wez Furlong a3a2dcd8a9 Relieve scripts of the burden of ensuring that all pipes are closed prior
to calling proc_close().
Implement proc_get_status(resource $process) which returns an array of
information about a process created with proc_open().
The information includes:
array(
	"command" => string "name of the command",
	"pid" => long process identifier,
	"running" => bool true if the process is still running
	"exitcode" => long exitcode if the process exited
	"signaled" => bool true if the process was signaled
	"termsig" => long signal number if signaled
	"stopped" => bool true if the process is stopped
	"stopsig" => long signal number if stopped
);
2003-01-15 18:54:03 +00:00

30 lines
365 B
PHP

--TEST--
proc_open
--SKIPIF--
<?php # vim:syn=php
if (!is_executable("/bin/cat")) echo "skip";
?>
--POST--
--GET--
--FILE--
<?php
$ds = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$cat = proc_open(
"/bin/cat",
$ds,
$pipes
);
proc_close($cat);
echo "I didn't segfault!\n";
?>
--EXPECT--
I didn't segfault!