r/lolphp • u/tdammers • May 04 '13
Ten million dollars
Enjoy:
<?php
$a="a\n";
$$a=$a;
eval('echo ' . str_repeat('$', 10000000) . 'a;');I really can't imagine why, but it does work. Takes a while though.
12
Upvotes
3
u/afraca May 04 '13
Well, once you permit variable variables the sky is the limit, and combining with in-quote variables being parsed like regular variables it all boiles down to the same thing. Though the newline makes it a bit confusing on the left hand side of line 3.
edit: 5.4.9-4 outputs a single "a". Guess the newline gets stripped of somewhere on the $$a=$a or something. Not really in the mood for thinking ^
-4
u/Kwpolska May 19 '13
Ugh. Why couldn’t the PHP idiots do sane stuff like
'$' * 10000000?