Created
September 14, 2013 19:06
-
-
Save rhenium/6564669 to your computer and use it in GitHub Desktop.
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 | |
$st = microtime(true); | |
for($i = 0; $i < 100000000; $i++) | |
echo 'testabcdeftestabcdeftestabcdeftestabcdeftestabcdeftest'; | |
$sm = microtime(true); | |
fwrite(STDERR, "single quote" . "\t" . ($sm - $st) . "\n"); | |
$st = microtime(true); | |
for($i = 0; $i < 100000000; $i++) | |
echo "testabcdeftestabcdeftestabcdeftestabcdeftestabcdeftest"; | |
$sm = microtime(true); | |
fwrite(STDERR, "double quote" . "\t" . ($sm - $st) . "\n"); | |
$test = "abcdef"; | |
$st = microtime(true); | |
for($i = 0; $i < 10000000; $i++) | |
echo 'test' . $test . 'test' . $test . 'test' . $test . 'test' . $test . 'test' . $test . 'test'; | |
$sm = microtime(true); | |
fwrite(STDERR, "single quote, dot" . "\t" . ($sm - $st) . "\n"); | |
$st = microtime(true); | |
for($i = 0; $i < 10000000; $i++) | |
echo "test" . $test . "test" . $test . "test" . $test . "test" . $test . "test" . $test . "test"; | |
$sm = microtime(true); | |
fwrite(STDERR, "double quote, dot" . "\t" . ($sm - $st) . "\n"); | |
$st = microtime(true); | |
for($i = 0; $i < 10000000; $i++) | |
echo "test", $test, "test", $test, "test", $test, "test", $test, "test", $test, "test"; | |
$sm = microtime(true); | |
fwrite(STDERR, "double quote, comma" . "\t" . ($sm - $st) . "\n"); | |
$st = microtime(true); | |
for($i = 0; $i < 10000000; $i++) | |
echo "test${test}test${test}test${test}test${test}test${test}test"; | |
$sm = microtime(true); | |
fwrite(STDERR, "double quote, \${i}" . "\t" . ($sm - $st) . "\n"); | |
$st = microtime(true); | |
for($i = 0; $i < 10000000; $i++) | |
echo "test{$test}test{$test}test{$test}test{$test}test{$test}test"; | |
$sm = microtime(true); | |
fwrite(STDERR, "double quote, {\$i}" . "\t" . ($sm - $st) . "\n"); | |
$st = microtime(true); | |
for($i = 0; $i < 10000000; $i++) | |
echo "test$test test$test test$test test$test test$test test"; | |
$sm = microtime(true); | |
fwrite(STDERR, "double quote, \$i" . "\t" . ($sm - $st) . "\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment