I wouldn't want to see a limit placed on recursion depth, IMHO it is the responsibility of the programmer to limit recursion not the language itself otherwise the language is limiting the programmer. Another possiblity is hitting the execution time limit, sounds like you are using IE with friendly errors turned on, I prefer turning them off.

Jason

Andrew Brampton wrote:

I was just testing PHP with this code:
<?php

function blah($varible) {

   if ($varible > 860)
       exit();

   echo $varible . '<br>';
   flush();

   blah($varible + 1);
}

blah(1);

?>

This would show 1 to 860, however if I tried any number greater than 860, ie
861 then the page would give the "This page cannot be displayed" page like
you were saying.

Normally apps in C, etc would throw a stack overflow error when you recursed
too high...

I'm guessing PHP doesn't implement this as a normal stack, and is crashing
out because we have hit the memory limit. The reason I say that is because
860 seems a very odd number to set the stack size to.

I'm also guessing that it wouldn't be too hard for the PHP Dev team to place
a limit on the recursion depth, or maybe it is a bit too hard and thats why
they didn't bother :)...

Andrew
----- Original Message -----
From: "Ronald van Raaphorst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 11:40 AM
Subject: Re: [PHP] suggestion: recursive calls




I normally program in clarion (www.softvelocity.com) and an infinite
recursive call will cause a heap overflow...

As I only got a "This page cannot be displayed" page, an error must have
occurred, but it's not displayed...
At first I thought I had lost contact with the site, but then, after a lot
of tracing, I found the source of the error.

Ronald



"Marek Kilimajer" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]


I don't think it is even possible, if the recursive calls don't seem
infinite to inteligent human being, how should a stupid computer program
find out.

Ronald van Raaphorst wrote:



Hi all,

Not a real bug, but a suggestion:
It would be nice if inifite recursive calls would somehow give an


error.


I spend quite some time to find the error in my php script.

Ronald



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php









-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to