Jump to content

Simple question


Manixa

Recommended Posts

Hello there fellow programmers,

 

I was just wondering if there was any difference between doing this:

 

echo "Say Something Here";

 

and this

 

echo "Say ";
echo "Something ";
echo "Here";

 

Thank you in advance.

 

Notice: I am aware of the fact that they will output the same thing, my question is regarding resources.

Link to comment
https://forums.phpfreaks.com/topic/252436-simple-question/
Share on other sites

first I would recommend to use single quotes instead of double quotes, because from a resources point of view, double quotes takes more processing resources because PHP checks the string for a variable to resolve it's value inside the string,  instead single quotes will be taken just as a string. So back to your question, the second option as is, it would take more resources than the first one, but if you use single quotes instead, should be the same.

Link to comment
https://forums.phpfreaks.com/topic/252436-simple-question/#findComment-1294258
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.