On Wed, 3 Jul 2024, Claude Pache wrote:

> > Le 1 juil. 2024 à 19:02, Larry Garfield <la...@garfieldtech.com> a 
> > écrit :
> > 
> > Hi folks.  As Ilija's been polishing off hooks to get the PR merged, 
> > we've run into two small revisions that should make life better for 
> > all involved.  One is a performance improvement that requires a very 
> > slight error handling behavior change, and the other is enabling 
> > readonly in selected (but probably all of the relevant) 
> > circumstances.
> > 
> > I'd say we expect these to be uncontroversial, but this is PHP. :-)  
> > So I will instead just note that it's a short RFC and open the 
> > discussion accordingly.
> > 
> > https://wiki.php.net/rfc/hook_improvements
> 
> 1. Removing the guard against recursion is sensible to me, as the sort 
> of bug it is supposed to prevent is not specific to property 
> accessors. IMO, a better solution to the issue is to implement a 
> global upper limit on the call stack size.

That is already done in PHP 8.4, if you end up using too much stack, PHP 
will now bail out graciously: 
https://github.com/php/php-src/blob/master/Zend/zend_call_stack.c

> Currently, I am able to generate a call stack of more than 10 millions 
> items before an OOM error occurs; PHP should have thrown a stack 
> overflow error long before that.

Why? Most actual function calls are not done on the stack any more. So 
it is now perfectly okay to have that many nested calls. If you want it 
to bail out earlier (during testing), then Xdebug will help you.

cheers,
Derick


-- 
https://derickrethans.nl | https://xdebug.org | https://dram.io

Author of Xdebug. Like it? Consider supporting me: https://xdebug.org/support

mastodon: @derickr@phpc.social @xdebug@phpc.social

Reply via email to