Skip to content

Fix gh 24497 hard limit default - #24515

Open
theworker02 wants to merge 6 commits into
php:masterfrom
theworker02:fix-gh-24497-hard-limit-default
Open

theworker02 wants to merge 6 commits into
php:masterfrom
theworker02:fix-gh-24497-hard-limit-default

Conversation

@theworker02

Copy link
Copy Markdown

Summary

Fixes #24497.

This pull request corrects the default configuration value reported by memory_hard_limit_percent, which was introduced as part of PHP's memory-limit security hardening.

Previously, the directive was registered with a NULL default, causing ini_get('memory_hard_limit_percent') to return an empty string instead of the expected -1.

Changes

  • Updated the directive registration in main/main.c to use "-1" instead of NULL.
  • Added PHPT tests covering configuration reporting and runtime overrides.
  • Added a GitHub Actions workflow to build PHP and execute the regression tests.

Expected Behavior

var_dump(ini_get('memory_hard_limit_percent'));

Expected output:

string(2) "-1"

The change is intended to make the reported default consistent with the existing automatic hard-limit behavior, without modifying the underlying memory allocation algorithm.

Testing

Related Issue

Fixes #24497

@TimWolla
TimWolla requested review from iluuu1994 and removed request for TimWolla October 21, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memory_hard_limit_percent reporting wrong default value when null

1 participant