Michaelo wrote:I started off confused and now I am more confused than ever...

I'm happy we could help

Go with the first post Highway had in this topic

It makes it all very clear and running the time script Highway had, sometimes double quotes come out faster than single quotes? just depends on the day

so the time difference of using them is negligible
I took Highways script and made it loop 1000 times and added up all the numbers and sometimes single is faster, other times double is faster? however, double is faster most of the time.
Here is the last time I refreshed the page
Single = 0.394691944122 ... Double = 0.2978079319 ... Result = 0.0968840122223
in that case, after going through it 1,000 times, double is faster by almost 1/100th of a second? not much either way.
The worst I have seen it for double is slower by almost 2/10ths of a second
and for single is almost 4/10ths of a second.
A_Jelly_Doughnut wrote:One thing to keep in mind: many (my self included) consider it bad form to do this:
- Code: Select all
$foo = "moo {$bar['asdf']};
phpBB uses that a lot in the new phpBB3.
Here is a bit of code from posting.php
- Code: Select all
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_time = $current_time
WHERE post_id = {$post_data['topic_last_post_id']}
AND topic_id = $topic_id";
$db->sql_query($sql);
As Highway pointed out, they use double quotes on almost every sql query, and using
- Code: Select all
"{$foo['bar']}";
is not bad coding? it just saves space and looks cleaner.
And you don't have to keep breaking out of quotes to get it done.