Liquid Fire Posted August 18, 2007 Share Posted August 18, 2007 Is the performance of the single quote(') really better than the double quote(")? I come from a C++ background and i alway used double quotes in there(not sure way) so for one it is more natural. I also think the code looks alot cleaner, for example: print("This is just some {$var1} random text {$var2} to show an example {$var3} of what i mean"); than print('This is just some' . $var1 . 'random text' . $var2 . 'to show an example' . $var3 . 'of what i mean'); This is just a quick example but some stuff i have seen it is just hard to see where the string stops and the variable start. I think if you script is running slow and you change all the " to ' that it will not make a big difference because soemthing else must be wrong. What do you think? Quote Link to comment https://forums.phpfreaks.com/topic/65547-single-over-double-qoutes-really-worth-it/ Share on other sites More sharing options...
cooldude832 Posted August 18, 2007 Share Posted August 18, 2007 Just another way to do quotes (its what ever you like as a programmer) PHP is very flexible and has very lose grammar like American English. <?php $var1 = "yes"; $var2 = 23; echo "The value of \"Var1\": ".$var1." <br/> The value of \"Var2\": ".$var2; /*output The value of "Var1": yes The value of "Var2": 23 */ ?> Quote Link to comment https://forums.phpfreaks.com/topic/65547-single-over-double-qoutes-really-worth-it/#findComment-327288 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.