php-src/ext/standard/tests/general_functions/bug39322.phpt

45 lines
765 B
Plaintext
Raw Normal View History

2007-02-14 19:20:15 +00:00
--TEST--
2007-05-07 16:50:40 +00:00
Bug #39322 (proc_terminate() loosing process resource)
2007-02-14 19:20:15 +00:00
--SKIPIF--
<?php
if (!is_executable('/bin/sleep')) echo 'skip sleep not found';
?>
--FILE--
<?php
$descriptors = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('pipe', 'w'));
$pipes = array();
$process = proc_open('/bin/sleep 120', $descriptors, $pipes);
proc_terminate($process);
sleep(1); // wait a bit to let the process finish
var_dump(proc_get_status($process));
echo "Done!\n";
?>
--EXPECTF--
2007-02-14 19:29:33 +00:00
array(8) {
[u"command"]=>
unicode(14) "/bin/sleep 120"
[u"pid"]=>
int(%d)
[u"running"]=>
bool(false)
[u"signaled"]=>
bool(true)
[u"stopped"]=>
bool(false)
[u"exitcode"]=>
int(-1)
[u"termsig"]=>
int(15)
[u"stopsig"]=>
int(0)
}
Done!