Re: [RFC] Exceptions in the engine
| From: | Andrea Faulds | Date: | Fri, 10 Oct 2014 20:43:12 +0000 |
| Subject: | Re: [RFC] Exceptions in the engine | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77858@lists.php.net to get a copy of this message | ||
On 10 Oct 2014, at 13:31, Patrick Schaaf <bof@bof.de> wrote:
> I would love to be able to catch, at toplevel. with an error handler or
> otherwise, both the memory limits exceeded and time limit exceeded cases.
>
> These two safeguards, by themselves, are not instabilities, right? The
> limits could be set a bit higher and everything would continue normally,
> right?
Both are problematic.
There’s no *technical* reason to prevent catching the exceeding of the time limit… but that
means you can circumvent the time limit. That’s bad. Perhaps you could catch it and have a short
window to output an error and die, though?
Memory limit catching *would* cause instability, though. That’s an error thrown during memory
allocation. Things will break horribly if it just returns NULL and carries on, because let’s be
realistic here, an awful lot of code doesn’t check for NULL return values. It’ll lead to a
segfault. PHP must bail out immediately when this happens to prevent segfaulting.
--
Andrea Faulds
http://ajf.me/