Late, but whatever. PHP 32 characters.
$r=function($z){$z($z);};$r($r);
gives Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261900 bytes) in ...
Technically, I could also do this at 29 using
$r=function($z){$z();};$r(0);
But this is not as fun as endless recursion. This, and I don’t think that the “undefined function” errors should be considered as “compilation” in the scripting language, otherwise:
Z();
will be the smallest solution.
Also, instead of crashing, how about (like a script) exceed the maximum execution time? 8 characters:
for(;;);
My initial take, which had $i++ in the third expression of the for loop, but because PHP treats all integers as signed rather than overflowing, is just negative.
Dereleased Nov 24 '09 at 18:28 2009-11-24 18:28
source share