Welcome Guest, Not a member yet? Register   Sign In
View code that hurts your brain
#7

[eluser]Hannes Nevalainen[/eluser]
Call
Code:
//This calls echo ONE time, but with many arguments...
echo $firstname, ' ', $lastname;
The speed boost is just marginal but since it's just as easy to write a comma intead of a dot so why not?

Actually double quotes are slower to use, and when you don't need your string to be parsed it's better to use single quotes. I allways use singlequotes when i'm working with pure strings, but when it's makes the code easier to read I use double quotes. This won't probably be the bottleneck of your app but it's just so easy to use those single quotes (or commas) instead. =)

Code:
$a = 'world';


$b = "hello $a"; //Easy.

$b = 'hello ' . $a; //Not so easy.

I don't wan't to start a war or something so maybe we can go back to the subject of this thread.


Messages In This Thread
View code that hurts your brain - by El Forum - 08-22-2008, 03:32 AM
View code that hurts your brain - by El Forum - 08-22-2008, 08:22 AM
View code that hurts your brain - by El Forum - 08-22-2008, 09:42 AM
View code that hurts your brain - by El Forum - 08-22-2008, 10:45 AM
View code that hurts your brain - by El Forum - 08-22-2008, 12:37 PM
View code that hurts your brain - by El Forum - 08-22-2008, 02:28 PM
View code that hurts your brain - by El Forum - 08-22-2008, 04:10 PM
View code that hurts your brain - by El Forum - 08-22-2008, 04:42 PM
View code that hurts your brain - by El Forum - 08-22-2008, 06:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB