1--TEST--
2pcntl_unshare() with CLONE_NEWUSER
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");
8if (!defined("CLONE_NEWUSER")) die("skip flag unavailable");
9if (@pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM) {
10    die("skip Insufficient privileges to use CLONE_NEWUSER");
11}
12?>
13--FILE--
14<?php
15
16$olduid = posix_getuid();
17pcntl_unshare(CLONE_NEWUSER);
18$newuid = posix_getuid();
19var_dump($olduid === $newuid);
20?>
21--EXPECT--
22bool(false)
23