Reply to Re: string concat vs. join/implode

Your name:

Reply:


Posted by NoWhereMan on 05/15/07 11:10

On Mon, 14 May 2007 22:36:46 +0100, Toby A Inkster wrote:

> The way Javascript deals with strings is entirely different to the way PHP
> does. In Javascript, strings are an immutable object, so the += operator
> doesn't just concatenate one new string onto an existing string object --
> it creates a brand new string object then reassigns the old string object
> variable to point to the new object, marking the old object for garbage
> collection.

that's right but in what a PHP string actually differs from a JS string? I
mean, in PHP strings are not objects but primitives, but how are they
internally handled?

I'm not sure they're not garbage collected as, say, arrays; in fact strings
are always array of chars, and arrays are usually passed by reference (in
PHP4 only arrays of arrays do, but there's always copy-on-write).

Of course, I'm not sure, that's why I asked

bye

--
NoWhereMan (e.v.)
-- http://www.nowhereland.it
-- http://flatpress.nowhereland.it

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация