How to intentionally cause a "Fatal error: Allowed memory size of xxx bytes exhausted"
Should eat all memory.
$a = 'x';
while (true) {
$a = $a.$a;
}
Here's the problem:
$test = "a" + $test;
+
in PHP is for arithmetic, not string concatination. Use:
$test = "a" . $test;
str_pad("",PHP_INT_MAX);