Hi all
I often use a print statement during debug like this:
print ("Variable1: ".$variable1."<br />Variable2: ".$variable2."<br />");
Then I read that concatenation slows the process down, and that I should replace the periods with commas.
Then I found that this works anyway:
print("Variable1: $variable1 <br /> Variable2: $variable2 <br />");
It seems to me the latter would be most efficient for PHP. It's certainly the fastest to type and easiest to read in the IDE.
Both print and echo are language constructs and the PHP manual says it doesn't matter which I use; it's down to personal preference. There's a small difference in performance between echo and print, but that for something as simple as the above it wouldn't make any difference.
What do the experts feel is is the most semantically correct in the above print statements - or would you use echo instead? It's one less keypress, after all...
Thanks