summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/proc_open.phpt
blob: a094b5c600f31a3b119f9b75b4d5cec3551793f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--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
		);

/* As per manual: avoid deadlock */
for ($i = 0; $i < count($pipes); $i++)
{
    fclose($pipes[$i]);
}

proc_close($cat);

echo "I didn't segfault!\n";

?>
--EXPECT--
I didn't segfault!