--- php-7.2.16/ext/posix/posix.c.orig	2019-04-03 05:18:04 +0000
+++ php-7.2.16/ext/posix/posix.c	2019-04-03 05:19:51 +0000
@@ -1420,6 +1420,17 @@
 		Z_PARAM_LONG(max)
 	ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
 
+	#if defined(_AIX)
+        /*
+        On AIX, when cur > max setrlimit returns 0 and sets softlimit and hardlimit to max,
+        instead of returning -1, so we need to check the values to reproduce the same behavior
+        as setrlimit on Linux.
+        */
+        if (cur > max) {
+              POSIX_G(last_error) = EINVAL;
+              RETURN_FALSE;
+        }
+	#endif
 	rl.rlim_cur = cur;
 	rl.rlim_max = max;
 
