-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add memory_get_limit() function #8380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I totally don't oppose that function, but I wonder whether we can just have a function giving the properly converted ini value. E.g. (name is up to discussion) |
Agree with @bwoebi conceptually, but I'm not sure this is really technically feasible. For |
We could add a mechanism for getting the value as a zval though (some function pointer). For most usages internally it would be totally non-breaking, because nearly everything uses a simple STD_PHP_INI_ENTRY. |
I'm wondering whether to add a whole mechanism to deal with every INI setting isn't over-engineering for this specific case? Has anybody asked for this for other INI settings? |
@derickr I can only talk for myself, but I've pushed at least once recently a bug into production because I did It's less "this is needed". More "this would be nice to have". Additionally I have one more specific use case: in ext/ddtrace we have quite a bunch of ini settings, of which some inis are parsed as arrays in specific ways. Such a function would enable exposing the internal array trivially instead of via an extra helper function. So no, it's not just this specific case. |
@rquadling already asked for this long time ago; and there is a somewhat related request regarding boolean values. |
11 years for a reply! Nice! (And thank you @cmb69 for checking!). Under normal conditions, values read from the ini/config space are converted and held in a useful/normalised form (https://github.com/krakjoe/apcu/blob/eb28fe1ab0918e604bd22c6c1c58bae5280b7d72/php_apc.c#L129 is one example of processing ini entries). If Of course if people are using But this would also help show up issues like this: https://www.php.net/manual/en/apcu.configuration.php#ini.apcu.slam-defense says the value is an int and is evaluated as a percentage. But https://github.com/krakjoe/apcu/blob/eb28fe1ab0918e604bd22c6c1c58bae5280b7d72/php_apc.c#L141 clearly shows this is a boolean value. I raised this as a possible issue in PHP-DI/PHP-DI#625 If nothing more, if And how about if there was a So, supplying an integer for |
Closes GH-7944