ID: 8471 Comment by: swright at everestgt dot com Reported By: vgo at nrd dot lt Status: Wont fix Bug Type: Reproducible crash Operating System: Windows 2000 PHP Version: 4.0.4 New Comment:
Is there a limit on the number of recursive loops one can have? I did a sample test script that looped only 10000 times and it crashs after ~753 loops. It crashes PHP.exe (win2k) running it at command line or under apache. I do not always get an error. One I did get was "FATAL: erealloc(): Unable to allocate 15 bytes". Thanks, Stan [EMAIL PROTECTED] ------------------------------------------------- <?php function recursive1( $z ) { if ( $z > 10000 ) { return(10); } else { print "<p> recursing $z </p>"; $z++; return( recursive1( $z ) ); } } $x = 1 ; print recursive1($x) ; ?> Previous Comments: ------------------------------------------------------------------------ [2002-08-23 06:56:18] [EMAIL PROTECTED] never ever.. ------------------------------------------------------------------------ [2000-12-29 19:17:40] [EMAIL PROTECTED] Chanching to suspended on Jani's request ------------------------------------------------------------------------ [2000-12-29 18:58:53] [EMAIL PROTECTED] PHP does not do infinite recursions, and there is no way to protect or check for this without making things much slower. ------------------------------------------------------------------------ [2000-12-29 01:56:11] vgo at nrd dot lt General configuration: WEB server Apache 1.3.14 php 4.0.4 running as the module for Apache. The infinite recursive call causes Unknown softaware exception (0xc00000fd) in Apache.exe Example: function checkIfLoggedIn() { checkIfLoggedIn(); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=8471&edit=1