[php-src] master: Improve posix_setrlimit() limit error message (#24417)

From: Date: Sun, 18 Oct 2026 20:29:23 +0000
Subject: [php-src] master: Improve posix_setrlimit() limit error message (#24417)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142427@lists.php.net to get a copy of this message
Author: Jorg Adam Sowa (jorgsowa) Committer: GitHub (web-flow) Pusher: jorgsowa Date: 2026-10-18T22:29:20+02:00 Commit: https://github.com/php/php-src/commit/b7256eee3018928d265830e5f523dcc848dea2b6 Raw diff: https://github.com/php/php-src/commit/b7256eee3018928d265830e5f523dcc848dea2b6.diff Improve posix_setrlimit() limit error message (#24417) Co-authored-by: David Carlier <devnexen@gmail.com> Changed paths: M ext/posix/posix.c M ext/posix/tests/posix_setrlimit.phpt Diff: diff --git a/ext/posix/posix.c b/ext/posix/posix.c index f6da93bfe8f3..f217199118db 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 ea81a944e431..754d68b0ed59 100644 --- a/ext/posix/tests/posix_setrlimit.phpt +++ b/ext/posix/tests/posix_setrlimit.phpt @@ -32,5 +32,5 @@ try { --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

« previous php.cvs (#142427) next »