You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* If max_memory_limit is not set to unlimited, verify change */
337
-
if (PG(max_memory_limit) !=-1) {
338
-
if (value==-1) {
339
-
zend_error(
340
-
E_WARNING,
341
-
"Failed to set memory_limit to unlimited. memory_limit (currently: "ZEND_LONG_FMT" bytes) cannot be set to unlimited if max_memory_limit ("ZEND_LONG_FMT" bytes) is not unlimited",
342
-
PG(memory_limit),
343
-
PG(max_memory_limit)
344
-
);
345
-
346
-
returnFAILURE;
336
+
/* If memory_limit exceeds max_memory_limit, warn and set to max_memory_limit instead. */
337
+
if (value>PG(max_memory_limit)) {
338
+
if (value!=-1) {
339
+
zend_error(E_WARNING,
340
+
"Failed to set memory_limit to %zd bytes. Setting to max_memory_limit instead (currently: "ZEND_LONG_FMT" bytes)",
341
+
value, PG(max_memory_limit));
347
342
}
348
343
349
-
if (value>PG(max_memory_limit)) {
350
-
zend_error(
351
-
E_WARNING,
352
-
"Failed to set memory_limit to %zd bytes. memory_limit (currently: "ZEND_LONG_FMT" bytes) cannot exceed max_memory_limit ("ZEND_LONG_FMT" bytes)",
Copy file name to clipboardExpand all lines: tests/basic/gh17951_ini_parse_4.phpt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ max_memory_limit=128M
9
9
<?php
10
10
echoini_get('max_memory_limit') . PHP_EOL;
11
11
echoini_get('memory_limit') . PHP_EOL;
12
-
--EXPECTF--
13
-
Warning: Failed to set memory_limit to unlimited. memory_limit (currently: %d bytes) cannot be set to unlimited ifmax_memory_limit (%d bytes) is not unlimited in %s
Copy file name to clipboardExpand all lines: tests/basic/gh17951_runtime_change_4.phpt
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,6 @@ max_memory_limit=512M
9
9
<?php
10
10
ini_set('memory_limit', '-1');
11
11
echoini_get('memory_limit');
12
-
--EXPECTF--
13
-
Warning: Failed to set memory_limit to unlimited. memory_limit (currently: %d bytes) cannot be set to unlimited ifmax_memory_limit (%d bytes) is not unlimited in %s
0 commit comments