I have (for example) this:
ini_set('memory_limit', '128M');
It varies between scripts and settings. I need to get the number of bytes -- not the string '128M' -- at runtime.
I have no use of the string 128M
, and do not wish to code my own parser to turn that (and all other symbols supported) into bytes.
How do I get the raw maximum number of bytes currently allowed for the current script?
(I'm coding a mechanism which is going to notify me when a script approaches its maximum allowed RAM usage, prior to it exceeding this, in order to send useful health reports to myself. Once it's already hit the roof, there is a FATAL error and it doesn't log properly.)