Question: which one of the 2 have the best performance?

In javascript I was heard douglas crockford say that you shouldn't use str += if you are concatenating a large string but use array.push instead.

I've seen lots of code where developers use $str .= to concatenate a large string in PHP as well, but since "everything" in PHP is based on arrays (try dumping an object), my thought was that the same rule applies for PHP.

Can anyone confirm this?

Answer: 
`.=` is for strings.

[`array_push()`](http://us2.php.net/manual/en/function.array-push.php) is for arrays.

They aren't the same thing in PHP. Using one on the other will generate an error.
array\_push() won't work for appending to a string in PHP, because PHP strings aren't really arrays (like you'd see them in C or JavaScript).