4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 PHP: Difference between single and double quotes
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Mon Jan 20, 2003 2:12 pm (21 years, 3 months ago) Reply with QuoteBack to Top

I know that text in double quotes gets parsed for variables. I was told that this would be slower than parsing text in single quotes. This seemed to make sense, but before changing 200Kb+ of PHP code, I did a little test, and found that there was no difference in speed between the two. So do I need to change my code, or not?
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Mon Jan 20, 2003 2:30 pm (21 years, 3 months ago) Reply with QuoteBack to Top

Hertzsprung,

There is a difference in speed, but it'll never be noticeable.

Don't bother changing 200kb of code just for that kind of thing. It's more trouble than it's worth. Just keep it in mind for next time you do some PHP coding. Wink

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Tue Jan 21, 2003 6:39 pm (21 years, 3 months ago) Reply with QuoteBack to Top

OT:
Daniel wrote:
[Don't bother changing 200kb of code just for that kind of thing. It's more trouble than it's worth.

Whats the trouble when we use "Replace All" Wink

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Tue Jan 21, 2003 6:58 pm (21 years, 3 months ago) Reply with QuoteBack to Top

jayant wrote:
OT:
Daniel wrote:
[Don't bother changing 200kb of code just for that kind of thing. It's more trouble than it's worth.

Whats the trouble when we use "Replace All" Wink


Trouble is you might not want to replace *ALL* your "

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Jan 21, 2003 7:30 pm (21 years, 3 months ago) Reply with QuoteBack to Top

And if you do, you have to escape all your ' Wink Only you can do that, not your text editor Sad.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Thu Jan 23, 2003 6:26 pm (21 years, 2 months ago) Reply with QuoteBack to Top

Daniel wrote:
And if you do, you have to escape all your ' Wink Only you can do that, not your text editor Sad.


I /could/ write a regex to do it, but it would take me longer than going through the whole lot and changing it!
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.12154 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme