FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » define ('NL', "<br />"); can I define a constant var ?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: define ('NL', "<br />"); can I define a constant var ? [message #180192 is a reply to message #180182] Wed, 23 January 2013 09:59 Go to previous messageGo to previous message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma:
Senior Member
Am 22.01.2013 20:08, schrieb Luuk:

> On 22-01-2013 19:58, Tim Streater wrote:
>> In article <6833t9-kme(dot)ln1(at)luuk(dot)invalid(dot)lan>, Luuk <luuk(at)invalid(dot)lan>
>> wrote:
[...]
>>> Why not simply use double-quotes everywhere.....
>>>
>>> $NL = "<br />";
>>> echo "This is $NL another line";
>>
>> Because the interpreter has to do more work with the string:
>>
>> <http://php.net/manual/en/language.types.string.php>
>>
>> If you do:
>>
>> $NL = '<br />';
>> echo 'This is ' . $NL . 'another line';
>>
>> then you avoid the double-quote altogether.
>
> and who is going to notice those msecs ?

You my not notice any difference when testing a script on your own. But
imagine a webserver with thousands of requests every hour - every
additional delay will put more load to the machine and then it *is*
important to avoid inefficient code.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Passing complex data back when using cURL
Next Topic: my blog
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 08:31:16 GMT 2024

Total time taken to generate the page: 0.04920 seconds