Also, I think that:
"stuff\n";
would be faster than:
'stuff'."\n";
(Though yes, 'stuff' is faster than "stuff")
Also, I think that:
"stuff\n";
would be faster than:
'stuff'."\n";
(Though yes, 'stuff' is faster than "stuff")
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Output:Code:<?php function avg($arr) { $total = 0; for($i = 0; $i < count($arr); ++$i) $total += $arr[$i]; return $total / count($arr); } $times1 = array(); $times2 = array(); for($i = 0; $i < 10000; ++$i) { $s = microtime(); 'Hello' . "\n"; array_push($times1, microtime() - $s); $s = microtime(); "Hello\n"; array_push($times2, microtime() - $s); } echo 'Average for single/double concatenation: ' . avg($times1) . "\n" . 'Average for only double: ' . avg($times2) . "\n"; ?>It is.Code:Average for single/double concatenation: 1.7569E-06 Average for only double: 1.6627E-06
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks