Skip to content

Commit 40f3722

Browse files
committed
Make sure to modify memory_limit value through the registered handler.
1 parent 010fbd0 commit 40f3722

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Zend/zend_string.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
636636
_(ZEND_STR_SINCE, "since") \
637637
_(ZEND_STR_GET, "get") \
638638
_(ZEND_STR_SET, "set") \
639+
_(ZEND_STR_MEMORY_LIMIT, "memory_limit") \
639640
_(ZEND_STR_8_DOT_0, "8.0") \
640641
_(ZEND_STR_8_DOT_1, "8.1") \
641642
_(ZEND_STR_8_DOT_2, "8.2") \

build/gen_stub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,6 +3029,7 @@ class StringBuilder {
30293029
"username" => "ZEND_STR_USERNAME",
30303030
"password" => "ZEND_STR_PASSWORD",
30313031
"clone" => "ZEND_STR_CLONE",
3032+
"memory_limit" => "ZEND_STR_MEMORY_LIMIT",
30323033
'8.0' => 'ZEND_STR_8_DOT_0',
30333034
'8.1' => 'ZEND_STR_8_DOT_1',
30343035
'8.2' => 'ZEND_STR_8_DOT_2',

main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ static PHP_INI_MH(OnChangeMaxMemoryLimit)
381381
return FAILURE;
382382
}
383383

384-
PG(memory_limit) = value;
385384
PG(max_memory_limit) = value;
385+
zend_alter_ini_entry(ZSTR_KNOWN(ZEND_STR_MEMORY_LIMIT), new_value, PHP_INI_ALL, stage);
386386

387387
return SUCCESS;
388388
}

0 commit comments

Comments
 (0)