PHP infinite recursion
What can I say? How about “toy language”?
$ php -r 'function foo() { foo(); } foo();'
Segmentation fault
I’m not saying that infinite recursion is a good idea, but during development it can happen by accident, and I don’t expect such a simple error to crash the PHP interpreter! (Also it took me about 20 minutes to debug this problem, as I had no idea where it happened, nor indeed what the problem was..)
PHP 5.2.6 on Linux 2.6.26 Debian
I get:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in Command line code on line 1
PHP 5.3.0 on osX 10.6.2
OK, that is an improvement, esp as it tells you the line number (which is what you want!)
i like ;)
You may like this in Bash then:
:(){ :|:& };:
Hint: Don’t try this on a system that you are not willing to reboot…