|
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
Navigation:
[Reply to this message]
|