1--TEST--
2Bug #34794 (proc_close() hangs when used with two processes)
3--SKIPIF--
4<?php
5if (!is_executable('/bin/cat')) echo 'skip cat not found';
6?>
7--FILE--
8<?php
9echo "Opening process 1\n";
10$process1 = proc_open('/bin/cat', array(0 => array('pipe', 'r'), 1 =>array('pipe', 'r')), $pipes1);
11
12echo "Opening process 2\n";
13$process2 = proc_open('/bin/cat', array(0 => array('pipe', 'r'), 1 =>array('pipe', 'r')), $pipes2);
14
15
16echo "Closing process 1\n";
17fclose($pipes1[0]);
18fclose($pipes1[1]);
19proc_close($process1);
20
21echo "Closing process 2\n";
22fclose($pipes2[0]);
23fclose($pipes2[1]);
24proc_close($process2);
25
26echo "Done\n";
27
28?>
29--EXPECTF--
30Opening process 1
31Opening process 2
32Closing process 1
33Closing process 2
34Done
35