Bug #13587 Updated: Recurence makes crash
| From: | jeroen@php.net | Date: | Sun, 07 Oct 2001 19:28:43 +0000 |
| Subject: | Bug #13587 Updated: Recurence makes crash | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67493@lists.php.net to get a copy of this message | ||
ID: 13587
Updated by: jeroen
Reported By: kelcon@ceti.pl
Old Status: Bogus
Status: Open
Bug Type: Reproducible crash
Operating System: Win98
PHP Version: 4.0.6
New Comment:
PHP shouldn't crash on this, rather a stack overflow error should be emitted. There's no
single circumstance that PHP may crash.
Of course it's impossible to check program logic at compile time, but a runtime error is
appropriate in this case.
Derick: Some languages DO support 'infinite' recursion (of course not in this way), they
use a technique called lazy evaluation.
Reproduced with latest CVS
Previous Comments:
------------------------------------------------------------------------
[2001-10-07 14:44:26] mfischer@php.net
What do you expect from an infinite recursion? You can't expect the parser knowing what you are
doing. What if you implement n! this way? How should the parser know it?
Btw, even perl segfaults on such things ;)
No bug -> bogusified.
- Markus
------------------------------------------------------------------------
[2001-10-07 14:41:48] derick@php.net
There is no clean way to catch this. PHP does not support infinite recursion, as no language does.
The performance hit is too big if this kind of checking was build in, and even then it's not
very easy to do in a smart way.
Closing,
Derick
------------------------------------------------------------------------
[2001-10-07 14:31:58] kelcon@ceti.pl
class someclass {
function error() {
return $this->error()
}
}
Running $instance->error() crashes php on windows (it should be catch when source is parsed).
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13587&edit=1