1--TEST--
2pcntl_unshare() with CLONE_NEWUSER
3--EXTENSIONS--
4pcntl
5posix
6--SKIPIF--
7<?php
8if (!function_exists("pcntl_unshare")) die("skip pcntl_unshare is not available");
9if (!defined("CLONE_NEWUSER")) die("skip flag unavailable");
10if (@pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM) {
11    die("skip Insufficient privileges to use CLONE_NEWUSER");
12}
13if (getenv("SKIP_REPEAT")) die("skip cannot be repeated");
14?>
15--FILE--
16<?php
17
18$olduid = posix_getuid();
19pcntl_unshare(CLONE_NEWUSER);
20$newuid = posix_getuid();
21var_dump($olduid === $newuid);
22?>
23--EXPECT--
24bool(false)
25