1--TEST--
2posix_setrlimit(): Basic tests
3--EXTENSIONS--
4posix
5--SKIPIF--
6<?php
7if (!function_exists('posix_setrlimit')) die('skip posix_setrlimit() not found');
8// On FreeBSD the second call does not report an error, though the limit isn't changed either.
9if (str_contains(PHP_OS, 'FreeBSD')) die('skip different behavior on FreeBSD');
10?>
11--FILE--
12<?php
13
14var_dump(posix_setrlimit(POSIX_RLIMIT_NOFILE, 128, 128));
15var_dump(posix_setrlimit(POSIX_RLIMIT_NOFILE, 129, 128));
16
17?>
18--EXPECT--
19bool(true)
20bool(false)
21