1--TEST--
2Test function pcntl_rfork() with wrong flags
3--EXTENSIONS--
4pcntl
5posix
6--SKIPIF--
7<?php
8	if (!function_exists('pcntl_rfork')) die('skip pcntl_rfork unavailable');
9?>
10--FILE--
11<?php
12echo "\n*** Test with RFMEM ***\n";
13try {
14	$pid = pcntl_rfork(32);
15} catch (ValueError $e) {
16	echo $e;
17}
18echo "\n*** Test with RFSIGSHARE ***\n";
19try {
20	$pid = pcntl_rfork(16384);
21} catch (ValueError $e) {
22	echo $e;
23}
24echo "\n*** Test with RFFDG|RFCFDG ***\n";
25try {
26	$pid = pcntl_rfork(RFFDG|RFCFDG);
27} catch (ValueError $e) {
28	echo $e;
29}
30?>
31--EXPECTF--
32*** Test with RFMEM ***
33ValueError: pcntl_rfork(): Argument #1 ($flags) must not include RFMEM value, not allowed within this context in %s
34Stack trace:
35#0 %s: pcntl_rfork(32)
36#1 {main}
37*** Test with RFSIGSHARE ***
38ValueError: pcntl_rfork(): Argument #1 ($flags) must not include RFSIGSHARE value, not allowed within this context in %s
39Stack trace:
40#0 %s: pcntl_rfork(16384)
41#1 {main}
42*** Test with RFFDG|RFCFDG ***
43ValueError: pcntl_rfork(): Argument #1 ($flags) must not include both RFFDG and RFCFDG, because these flags are mutually exclusive in %s
44Stack trace:
45#0 %s: pcntl_rfork(4100)
46#1 {main}
47