Created
August 4, 2010 20:06
-
-
Save jakubkulhan/508700 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| $time = microtime(true); | |
| $i = 0; | |
| loop: | |
| if ($i >= 1000) goto endloop; | |
| $ret = dummy($i); | |
| ++$i; | |
| goto loop; | |
| endloop: | |
| echo microtime(true) - $time, "\n"; | |
| exit(); | |
| function dummy($i) | |
| { | |
| return $i + $i; | |
| } |
This file contains hidden or 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 | |
| $stack = array(); | |
| $time = microtime(true); | |
| $i = 0; | |
| loop: | |
| if ($i >= 1000) goto endloop; | |
| array_push($stack, $i); | |
| goto dummy; | |
| L1: $ret = array_pop($stack); | |
| ++$i; | |
| goto loop; | |
| endloop: | |
| echo microtime(true) - $time, "\n"; | |
| exit(); | |
| dummy: | |
| $_i = array_pop($stack); | |
| array_push($stack, $_i * $_i); | |
| goto L1; |
This file contains hidden or 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 | |
| $time = microtime(true); | |
| $i = 0; | |
| loop: | |
| if ($i >= 1000) goto endloop; | |
| goto dummy; | |
| L1: ++$i; | |
| goto loop; | |
| endloop: | |
| echo microtime(true) - $time, "\n"; | |
| exit(); | |
| dummy: | |
| $ret = $i * $i; | |
| goto L1; |
This file contains hidden or 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 | |
| $time = microtime(true); | |
| $_addr = 1; | |
| $i = 0; | |
| loop: | |
| if ($i >= 1000) goto endloop; | |
| $_0 = 'ret'; | |
| $_1 = 'i'; | |
| goto dummy; | |
| L1: ++$i; | |
| goto loop; | |
| endloop: | |
| echo microtime(true) - $time, "\n"; | |
| exit(); | |
| dummy: | |
| $$_0 = $$_1 * $$_1; | |
| goto L1; |
This file contains hidden or 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 | |
| $stack = array(); | |
| $stack_sp = -1; | |
| $time = microtime(true); | |
| $i = 0; | |
| loop: | |
| if ($i >= 1000) goto endloop; | |
| $stack[++$stack_sp] = $i; | |
| goto dummy; | |
| L1: $ret = $stack[$stack_sp]; unset($stack[$stack_sp--]); | |
| ++$i; | |
| goto loop; | |
| endloop: | |
| echo microtime(true) - $time, "\n"; | |
| exit(); | |
| dummy: | |
| $_i = $stack[$stack_sp]; unset($stack[$stack_sp--]); | |
| $stack[++$stack_sp] = $_i * $_i; | |
| goto L1; |
This file contains hidden or 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 | |
| $time = microtime(true); | |
| $obj = new Dummy; | |
| $i = 0; | |
| loop: | |
| if ($i >= 1000) goto endloop; | |
| $ret = $obj->dummy($i); | |
| ++$i; | |
| goto loop; | |
| endloop: | |
| echo microtime(true) - $time, "\n"; | |
| exit(); | |
| class Dummy | |
| { | |
| function dummy($i) | |
| { | |
| return $i + $i; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment