Re: PHP 4.0 Bug #2004: recursive call limitation

From: Date: Tue, 10 Aug 1999 17:24:58 +0000
Subject: Re: PHP 4.0 Bug #2004: recursive call limitation
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-9726@lists.php.net to get a copy of this message
At 19:00 10/08/99 , Andi Gutmans wrote: but a compile-time switch will be more than a good news ... and a level
of 1 million will be safe.
After all I said, it can be improved, for example, in zend_execute.c you can change on line 860+ the do_alloca and free_alloca macro's to use emalloc and efree. However, it'll slow things down a bit.
I have nothing to add about the technical aspects - but I just want to stress that the limit you're talking about, of one million nesting levels, is completely ridiculous. Generally, if you have a script that calls ANY function one million times, whether it's recursive or not, you shouldn't be using a scripting language. Moreover, recursive algorithms are almost inefficient to implement in structured languages, and you should never ever reach a depth of that magnitude. As a rule of the thumb, if you reached a depth level of more than a few thousand functions (which should be also very very very rare) - it's time to go back to the drawing board, since you're doing something wrong. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.dev (#9726) next »