Re: About restricting the recursive implicit calls
| From: | Stas Malyshev | Date: | Fri, 06 Jun 2014 07:07:00 +0000 |
| Subject: | Re: About restricting the recursive implicit calls | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-74772@lists.php.net to get a copy of this message | ||
Hi!
> if we are concerned about the perf cost of counting and checking the
> recursion, and that the default value would break some application,
> maybe we could introduce this as an optional feature: the ini
> setting is 0 by default, which will disable even the checks for
> recursion, so people have to opt-in to use it and it's their burden
> to configure it properly.
The problem here is not even that we break some app, but that stack
depths and stack requirements are very different in different OSes,
situations, etc. and that means the spaces which may break the app and
the spaces where it still crashes may intersect, so it is not at all
guaranteed that there's a predictable value for which the app always
works and the stack is still safe.
> maybe we can do something in the next major version which would
> allow us to gracefully bail from these kind of errors without
> imposing arbitrary limits?
I don't know a way to check for potential stack depletion that would
work in a portable way. Different calls may consume different amounts of
stack space, so it's kind of hard to predict it in advance. Once it
happened, I don't think you can gracefully bail from it.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227