File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed
ext/standard/tests/general_functions Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-10239 (proc_close after proc_get_status always returns -1)
3
+ --SKIPIF--
4
+ <?php
5
+ if (PHP_OS != "Linux " ) die ("skip, only for linux " );
6
+ if (getenv ("SKIP_SLOW_TESTS " )) die ('skip slow test ' );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ $ p = proc_open ('sleep 1 ' , array (), $ foo );
11
+ do {
12
+ usleep (100000 );
13
+ $ s = proc_get_status ($ p );
14
+ } while ($ s ['running ' ]);
15
+ echo proc_close ($ p ), PHP_EOL ;
16
+ ?>
17
+ --EXPECT--
18
+ 0
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-10239 (proc_close after proc_get_status always returns -1)
3
+ --SKIPIF--
4
+ <?php
5
+ if (PHP_OS != "Linux " ) die ("skip, only for linux " );
6
+ if (getenv ("SKIP_SLOW_TESTS " )) die ('skip slow test ' );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ $ p = proc_open ('false ' , array (), $ foo );
11
+ usleep (2 * 1000 * 1000 );
12
+ var_dump (proc_get_status ($ p ));
13
+ var_dump (proc_get_status ($ p ));
14
+ ?>
15
+ --EXPECTF--
16
+ array(8) {
17
+ ["command"]=>
18
+ string(5) "false"
19
+ ["pid"]=>
20
+ int(%d)
21
+ ["running"]=>
22
+ bool(false)
23
+ ["signaled"]=>
24
+ bool(false)
25
+ ["stopped"]=>
26
+ bool(false)
27
+ ["exitcode"]=>
28
+ int(1)
29
+ ["termsig"]=>
30
+ int(0)
31
+ ["stopsig"]=>
32
+ int(0)
33
+ }
34
+ array(8) {
35
+ ["command"]=>
36
+ string(5) "false"
37
+ ["pid"]=>
38
+ int(%d)
39
+ ["running"]=>
40
+ bool(false)
41
+ ["signaled"]=>
42
+ bool(false)
43
+ ["stopped"]=>
44
+ bool(false)
45
+ ["exitcode"]=>
46
+ int(1)
47
+ ["termsig"]=>
48
+ int(0)
49
+ ["stopsig"]=>
50
+ int(0)
51
+ }
You can’t perform that action at this time.
0 commit comments