note 112965 added to function.echo
| From: | doydoy44 | Date: | Tue, 13 Aug 2013 08:17:10 +0000 |
| Subject: | note 112965 added to function.echo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195946@lists.php.net to get a copy of this message | ||
apparently ',' is faster then '.'
<?php
function f1_virgule() {
$a = '';
for($i=0; $i<100000; ++$i) {
echo $a,$i,"\n";
}
}
function f2_point() {
$a = '';
for($i=0; $i<100000; ++$i) {
echo $a.$i."\n";
}
}
$start = microtime(true);
f2_point();
$stop = microtime(true);
$time_point = $stop - $start;
$start = microtime(true);
f1_virgule();
$stop = microtime(true);
$time_virgule = $stop - $start;
echo 'time virgule : ' . $time_virgule . "\n";
echo 'time point : ' . $time_point . "\n";
echo 'time virgule > time time_point => ' . ($time_virgule > $time_point);
?>
-------------------------------------
time virgule : 18.28688621521
time point : 17.781190156937
time virgule > time time_point => 1
----
Server IP: 69.147.83.199
Probable Submitter: 90.83.108.121
----
Manual Page -- http://php.net/manual/en/function.echo.php
Edit -- https://master.php.net/note/edit/112965
Del: integrated -- https://master.php.net/note/delete/112965/integrated
Del: useless -- https://master.php.net/note/delete/112965/useless
Del: bad code -- https://master.php.net/note/delete/112965/bad+code
Del: spam -- https://master.php.net/note/delete/112965/spam
Del: non-english -- https://master.php.net/note/delete/112965/non-english
Del: in docs -- https://master.php.net/note/delete/112965/in+docs
Del: other reasons-- https://master.php.net/note/delete/112965
Reject -- https://master.php.net/note/reject/112965
Search -- https://master.php.net/manage/user-notes.php