Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 3rd, 2008, 11:45 PM
Leigh Finch
Guest
 
Posts: n/a
Default $string .= $new vs $string = $string . $new performance

Hey Guys,
Quick question about the PHP compiler, is there any performance
difference between

$string .= $new;

and

$string = $string . $new;

Does the compiler see them as equivalent and optimize to the later, or
does concatenate and then copy?

Can anyone point me to some documentation on this, I havent been able to
find anything on this particular topic?

Cheers
Leigh Finch
  #2  
Old July 3rd, 2008, 11:55 PM
Michael Fesser
Guest
 
Posts: n/a
Default Re: $string .= $new vs $string = $string . $new performance

..oO(Leigh Finch)
Quote:
>Quick question about the PHP compiler, is there any performance
>difference between
>
>$string .= $new;
>
>and
>
>$string = $string . $new;
>
>Does the compiler see them as equivalent and optimize to the later, or
>does concatenate and then copy?
Don't worry and google "premature optimization" if you want to.

Micha
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles