|
|||||||
| PHP Discussion and technical support for using and deploying PHP based websites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
ermm ' over "
Ok, so I heard that you only use " when theres a variable involved, because it takes up time... other wise use '.. right? well.. what if you have \n?.. THe ' doesn't work with \n.. so should I use " or say 'this text.. + new line ' . "\n"; hm? This is probably a dumb question, but up until now, I thought I knew php pretty well, but it turns out theres much for me to learn, so thats why I'm asking.. I'm expecting that it wold be easier to use " because then it doesn't compute two different things..
hehe thanks.. Kyle
__________________
Cornflakes mmmm yummy
|
|
#2
|
||||
|
||||
|
The time difference - if any - is so minimal that I wouldn't worry about it unless I were programming a mission-critical realtime system. And if I were doing that, I wouldn't be using PHP. (You're probably talking savings of a few milliseconds or even just microseconds, depending on the server where your code is running).
Probably of much more importance 99.99% or so of the time is to keep your code as easy to read as possible by you, so that you can make changes at some later time with a minimum of agony.
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#3
|
||||
|
||||
|
Hm- i was just reading some things online, and they are like ommeeegod save time!! >_<!!!! so yeah- just questioning it! :P
__________________
Cornflakes mmmm yummy
|
|
#4
|
||||
|
||||
|
Try this little test, and refresh the page a few times (to account for random variations in processing time):
PHP Code:
Quote:
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#5
|
|||
|
|||
|
I used to use ' but then I started C++ and C# and what not, so now I use " but don't use the variable parsing ability. (sorry, it seemed relevant when I typed it)
__________________
Corn is no place for a mighty warrior! |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|