1--TEST--
2pcntl_unshare() with wrong flag
3--SKIPIF--
4<?php
5if (!extension_loaded("pcntl")) die("skip");
6if (!extension_loaded("posix")) die("skip posix extension not available");
7if (!function_exists("pcntl_unshare")) die("skip pcntl_unshare is not available");
8try {
9    if (@pcntl_unshare(42) == false && pcntl_get_last_error() == PCNTL_EPERM) {
10        die('skip Insufficient previleges');
11    }
12} catch (\ValueError $e) {}
13?>
14--FILE--
15<?php
16
17try {
18    pcntl_unshare(42);
19} catch (ValueError $exception) {
20    echo $exception->getMessage() . "\n";
21}
22
23?>
24--EXPECT--
25pcntl_unshare(): Argument #1 ($flags) must be a combination of CLONE_* flags
26