Re: [SMARTY-DEV] Re: [SMARTY]Re:[SMARTY-DEV]$smarty.session.object doesn't work in 2.5.0

From: Date: Tue, 15 Apr 2003 20:58:56 +0000
Subject: Re: [SMARTY-DEV] Re: [SMARTY]Re:[SMARTY-DEV]$smarty.session.object doesn't work in 2.5.0
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1173@lists.php.net to get a copy of this message
On Tue, Apr 15, 2003 at 10:43:44PM +0200, Wom.bat wrote: > > reference-counting is used internally by php for garbage-collection, > > AFAIK, but not visible to the application-programmer. but any > > assignment implies a copy of the data. > no, right THAT is NOT done... > > > try sth. like this: > > > > 1: $a = array('a'); > > 2: $b = $a; > > 3: $a[] = 'b'; > > > > > > if a reference was assigned in line 2, then $b would be "array('a', > > 'b')" > > since it references the same entity as $a. but since a copy is done in > line > > 2, $a is changed in line 3, but $b is not. > in line 2, $b is a reference to the value of $a ($a is a reference to the > value of $a, too) > a copy of $b is created in line 3 ($b is old $a), and $a gets changed > (additional row, key "1", value "b") okay, agreed. then it's copy-on-write. > Regards ;)))) > David

« previous php.smarty.dev (#1173) next »