Download | Plain Text | No Line Numbers


  1. --- a/build/gen_stub.php 2026-02-10 19:25:51.000000000 +0100
  2. +++ b/build/gen_stub.php 2026-03-12 22:21:02.653934390 +0100
  3. @@ -3029,6 +3029,7 @@
  4. "username" => "ZEND_STR_USERNAME",
  5. "password" => "ZEND_STR_PASSWORD",
  6. "clone" => "ZEND_STR_CLONE",
  7. + "memory_limit" => "ZEND_STR_MEMORY_LIMIT",
  8. '8.0' => 'ZEND_STR_8_DOT_0',
  9. '8.1' => 'ZEND_STR_8_DOT_1',
  10. '8.2' => 'ZEND_STR_8_DOT_2',
  11. --- a/main/main.c 2026-03-12 22:19:31.115021800 +0100
  12. +++ b/main/main.c 2026-03-12 22:21:24.390432386 +0100
  13. @@ -378,12 +378,18 @@
  14. }
  15.  
  16. if (zend_set_memory_limit(value) == FAILURE) {
  17. - zend_error(E_ERROR, "Failed to set memory limit to %zd bytes (Current memory usage is %zd bytes)", value, zend_memory_usage(true));
  18. - return FAILURE;
  19. + if (stage != ZEND_INI_STAGE_DEACTIVATE) {
  20. + zend_error(E_ERROR, "Failed to set memory limit to %zd bytes (Current memory usage is %zd bytes)", value, zend_memory_usage(true));
  21. + return FAILURE;
  22. + }
  23. }
  24.  
  25. - PG(memory_limit) = value;
  26. PG(max_memory_limit) = value;
  27. + if (stage == ZEND_INI_STAGE_DEACTIVATE) {
  28. + PG(memory_limit) = value;
  29. + } else {
  30. + zend_alter_ini_entry(ZSTR_KNOWN(ZEND_STR_MEMORY_LIMIT), new_value, PHP_INI_ALL, stage);
  31. + }
  32.  
  33. return SUCCESS;
  34. }
  35. --- a/Zend/zend_string.h 2026-02-10 19:25:51.000000000 +0100
  36. +++ b/Zend/zend_string.h 2026-03-12 22:21:02.655401423 +0100
  37. @@ -636,6 +636,7 @@
  38. _(ZEND_STR_SINCE, "since") \
  39. _(ZEND_STR_GET, "get") \
  40. _(ZEND_STR_SET, "set") \
  41. + _(ZEND_STR_MEMORY_LIMIT, "memory_limit") \
  42. _(ZEND_STR_8_DOT_0, "8.0") \
  43. _(ZEND_STR_8_DOT_1, "8.1") \
  44. _(ZEND_STR_8_DOT_2, "8.2") \
  45.