Connecting Tech Pros Worldwide Help | Site Map

$string .= $new vs $string = $string . $new performance

Leigh Finch
Guest
 
Posts: n/a
#1: Jul 3 '08
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
Michael Fesser
Guest
 
Posts: n/a
#2: Jul 3 '08

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
Closed Thread