Created
April 18, 2010 13:06
-
-
Save raphaelm/370212 to your computer and use it in GitHub Desktop.
PHP echo "",""; VS echo ""."";
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 | |
ob_start(); | |
$start = microtime(1); | |
for($i = 0; $i < 1000000; $i++){ | |
echo "abc", "def", "ghi", "jkl", "mno", "pqr"; | |
} | |
$end = microtime(1); | |
ob_end_clean(); | |
echo "Kommas: ".(($end-$start)/1000000)."\n"; | |
ob_start(); | |
$start = microtime(1); | |
for($i = 0; $i < 1000000; $i++){ | |
echo "abc"."def"."ghi"."jkl"."mno"."pqr"; | |
} | |
$end = microtime(1); | |
ob_end_clean(); | |
echo "Punkte: ".(($end-$start)/1000000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typical output:
Kommas: 4.37817811966E-7
Punkte: 5.49797058105E-7