Skip to content

Instantly share code, notes, and snippets.

@nickl-
Created February 6, 2013 17:01
Show Gist options
  • Select an option

  • Save nickl-/4724022 to your computer and use it in GitHub Desktop.

Select an option

Save nickl-/4724022 to your computer and use it in GitHub Desktop.
$ time php complex.php real 3m9.142s user 0m32.125s sys 0m0.358s
<?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() {
$jumps = new Jumps;
if (foo() && bar() && (baz() || bat())) {
lorem();
ipsum();
if (dolor() || sit() || amet()) {
$quick = brown();
while (fox()) {
$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