Commit b7256eee301 for php
commit b7256eee3018928d265830e5f523dcc848dea2b6
Author: Jorg Adam Sowa <jorg.sowa@gmail.com>
Date: Sun Oct 18 22:29:20 2026 +0200
Improve posix_setrlimit() limit error message (#24417)
Co-authored-by: David Carlier <devnexen@gmail.com>
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index f6da93bfe8f..f217199118d 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -1235,12 +1235,12 @@ PHP_FUNCTION(posix_setrlimit)
ZEND_PARSE_PARAMETERS_END();
if (!POSIX_RLIM_VALID(cur)) {
- zend_argument_value_error(2, "must be greater or equal to -1");
+ zend_argument_value_error(2, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY");
RETURN_THROWS();
}
if (!POSIX_RLIM_VALID(max)) {
- zend_argument_value_error(3, "must be greater or equal to -1");
+ zend_argument_value_error(3, "must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY");
RETURN_THROWS();
}
diff --git a/ext/posix/tests/posix_setrlimit.phpt b/ext/posix/tests/posix_setrlimit.phpt
index ea81a944e43..754d68b0ed5 100644
--- a/ext/posix/tests/posix_setrlimit.phpt
+++ b/ext/posix/tests/posix_setrlimit.phpt
@@ -32,5 +32,5 @@
--EXPECT--
bool(true)
ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128
-ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1
-ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1
+ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY
+ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater than or equal to -1, or POSIX_RLIMIT_INFINITY