Re: RE: session

From: Date: Mon, 08 Jan 2001 16:56:51 +0000
Subject: Re: RE: session
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33252@lists.php.net to get a copy of this message
At 12:22 8.1. 2001, Philip Olson wrote the following: -------------------------------------------------------------- >Regarding the proposed reasoning for it not working from Tim, I find >conflicting evidence. For example, try this : > >$a = array('a','b','c'); > >foreach ($a as $key => $value) { # $key & $value are indeed copies of their counterparts in $a, that is # to say, they're not references. # however, regular scoping rules apply, and > $a[$key] = $value . $key; # here, you overwrite value of $a[ 1 ] ('a') with 'a1' etc. >} >print_r($a); > >The array does indeed change. It does work on a copy but one still can >modify it if one decides to, as demonstrated above. Perhaps a kind soul >can explain the meaning of it "working on a copy" as described in the >manual with an example on why it matters (possible mishaps). ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. cynic@mail.cz

« previous php.general (#33252) next »