php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1901 recursive call limitation
Submitted: 1999-07-28 06:11 UTC Modified: 1999-08-07 12:25 UTC
From: gregori at datanetms dot co dot uk Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Beta 1 OS: linux (RedHat 6)
Private report: No CVE-ID: None
 [1999-07-28 06:11 UTC] gregori at datanetms dot co dot uk
I guess that it's not a common thing that we are supposed to do with a script language but I think it's important to let you know ...

netscape 4.6 gave me "the document contained no data ..." with this script :

<html>
<body bgcolor="#ffffff" text="#000088">
<?php
function nothing($val) {
  if ($val <=0 ) return(0);
  nothing($val - 1);
}

echo "<br>simple function ... ";
echo "<br>recursive function ... ";
$debut = time();
nothing(8192);
$end = time();
echo "<center>Execution time : ".($end - $debut)."</center>";
?>
</body>
</html>


Note : the script works fine with nothing(8191) or a smaller value. 
Note2: C++ support a such number of recursive call.

Is it important ?! I really dunno ...

gregori

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-07 12:25 UTC] zeev at cvs dot php dot net
PHP 4.0 (Zend) uses the stack for intensive data, rather than using
the heap.  That means that its tolerance recursive functions
is significantly lower than that of other languages.

It's relatively easy to tell Zend not to use the stack for this
data, and use the heap instead - which would greatly increase the
number of recursive functions possible - in the price of reduced
speed.  If you're interested in such a setting, let me know, we
may add a compile-time switch.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 14:01:30 2024 UTC