Created
February 6, 2013 17:03
-
-
Save nickl-/4724033 to your computer and use it in GitHub Desktop.
$ time php deep-heart.php real 4m37.395s
user 0m46.954s
sys 0m0.434s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function foo() { return true; } | |
function bar() { return true; } | |
function baz() { return false; } | |
function bat() { return true; } | |
function lorem() { return true; } | |
function ipsum() { return true; } | |
function dolor() { return false; } | |
function sit() { return false; } | |
function amet() { return true; } | |
function brown() { return true; } | |
function fox() { static $rep = 0; return ++$rep%2; } | |
class Lazy {} | |
class Jumps | |
{ | |
public $over; | |
public function dog() {} | |
} | |
function example() { | |
if (fooBarLogic()) { | |
loremIpsumAndQuickFox(); | |
} | |
} | |
function fooBarLogic() { | |
return foo() && bar() && (baz() || bat()); | |
} | |
function loremIpsumAndQuickFox() { | |
lorem(); | |
ipsum(); | |
if (dolorSitAmetLogic()) { | |
postLorem(); | |
} | |
} | |
function postLorem() { | |
$quick = brown(); | |
jumpsOver(); | |
} | |
function dolorSitAmetLogic() { | |
return dolor() || sit() || amet(); | |
} | |
function jumpsOver() { | |
$jumps = new Jumps; | |
while (fox()) { | |
lazyDog($jumps); | |
} | |
} | |
function lazyDog($jumps) { | |
$jumps->over = new Lazy; | |
$jumps->dog(); | |
} | |
foreach (range(0,1000000) as $i) | |
example(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment