posix_setrlimit

FunctionParams and return types changed in PHP 8.0

Set system resource limits.

PHP 5
PHP 7.0
Added
PHP 7.1-7.4
PHP 8.0
Improved
PHP 8.1
PHP 8.2-8.3
PHP 8.4
PHP 8.5
PHP 8.6

posix_setrlimit Function synopsis

posix_setrlimit(
    int $resource,
    int $soft_limit,
    int $hard_limit
  ): bool

Parameters

$resource

Typeint

The resource limit constant corresponding to the limit that is being set.

$soft_limit

Typeint

The soft limit, in whatever unit the resource limit requires, or POSIX_RLIMIT_INFINITY.

$hard_limit

Typeint

The hard limit, in whatever unit the resource limit requires, or POSIX_RLIMIT_INFINITY.

Return value

Typebool

Returns true on success, false on failure

Changes to the posix_setrlimit Function

PHP 8.0

  • Return type added: bool
  • Parameter type added for parameter #1 ($resource): int
  • Parameter name of parameter #2 changed: $softlimit to $soft_limit
  • Parameter type added for parameter #2 ($soft_limit): int
  • Parameter name of parameter #3 changed: $hardlimit to $hard_limit
  • Parameter type added for parameter #3 ($hard_limit): int
  posix_setrlimit(
-     $resource,
+     int $resource,
-     $softlimit,
+     int $soft_limit,
-     $hardlimit
+     int $hard_limit
-   )
+   ): bool

PHP 7.0

  • Function added

posix_setrlimit Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported No
PHP 5.5Unsupported No
PHP 5.4Unsupported No
PHP 5.3Unsupported No