variable = single quote vs variable = double quotes

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
User avatar
warmweer
Registered User
Posts: 2160
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

variable = single quote vs variable = double quotes

Post by warmweer » Fri Jul 04, 2003 8:46 pm

While updating my 2.0.4 board to 2.0.5 I noticed that in admin\admin_users.php the code was changed from

Code: Select all

$phpbb_root_path = "./../";
in 2.0.4
to

Code: Select all

$phpbb_root_path = './../';
in 2.0.5

Strangely enough in
admin_styles.php
admin_board.php
admin_db_utilities.php
admin_ug_auth.php
index.php
these changes weren't done.

Ok, one will be parsed and the other treated as a fixed string (perhaps a slight gain in speed) but my question is: Is there a specific reason for this (of which I'm apparently unaware :( ) and does it really make a difference (I've tried both and noticed nothing)?
My board's not broken, it just went peculiar

User avatar
zeroK
Former Team Member
Posts: 20964
Joined: Sun Jan 20, 2002 7:36 pm
Location: Klagenfurt / Austria
Contact:

Post by zeroK » Fri Jul 04, 2003 8:48 pm

In this case it doesn't matter but for example if you have a variable between " " it will be used. If you have it between ' ' it won't ;-)
Image My weblog | gamerslog.com | No support via PM or ICQ or email - If you don't know a term or a program mentioned in a post -> Google is your friend

User avatar
warmweer
Registered User
Posts: 2160
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Post by warmweer » Fri Jul 04, 2003 9:27 pm

zeroK wrote: In this case it doesn't matter but for example if you have a variable between " " it will be used. If you have it between ' ' it won't ;-)


thx for the quick reply but :Oops, you almost lost me there (already! you think ;) )
Let's see if I got this right

set variable is equal to nickname
the output of 'variable' would be the string variable but
the output of "variable" would be the string warmweer

Am I then correct in assuming that the code with single quote will execute faster since there will be no checking for variables?
My board's not broken, it just went peculiar

User avatar
warmweer
Registered User
Posts: 2160
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Post by warmweer » Mon Jul 07, 2003 6:51 am

I apologise for bumping and realise that my question is seemingly not phpbb related (and as thus insn't supposed to be in Support) BUT it actually is (I'm cleaning out my adaptations after updating to 2.0.5 on testsite in order to keep the code as clean as possible).

Perhaps moving this to another forum (rather than me asking this again in Chat (eg) would be better (I'll accept the blame gladly ;) )
My board's not broken, it just went peculiar

Locked

Return to “2.0.x Support Forum”