[php-src] Issue #7944: api to set memory_limit to "at least" this much
| From: | cmb69 | Date: | Wed, 19 Jan 2022 11:35:29 +0000 |
| Subject: | [php-src] Issue #7944: api to set memory_limit to "at least" this much | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239132@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7944
Comment Author: cmb69
> wonder how "unlimited" would be represented in such a function tho, […]
There is no "unlimited"; that would just be a very large value, never reached in practise.
The
memory_limit is internally stored as zend_long and
size_t.
> This will help OP, but I wonder if there is a chance to add callback for when ini settings are
> changed, […]
That may be a good idea, or maybe not.
Anyhow, what to implement exactly obviously requires discussion, and [warrants an
RFC](https://wiki.php.net/rfc/howto).
> Also ini_set supposed to return false on failure, but if you try setting ridiculous value like
> ini_set('memory_limit', '2K') you'll get old value, […]
That is supposed to be fixed as of PHP 8.1.0: https://3v4l.org/psYLo