Re: foreach, side effect or good behaviour?
| From: | Stephan Seidt | Date: | Mon, 23 Sep 2002 13:36:38 +0000 |
| Subject: | Re: foreach, side effect or good behaviour? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117260@lists.php.net to get a copy of this message | ||
It's good behavoiur because everytime even a reference gets a value,
also the target which it is pointing on should get the same value.
On Mon, 23 Sep 2002 12:57:56 +0200 (CEST), jparneodo@yahoo.fr (Jean-Pierre arneodo) wrote:
> Hi,
>
> $a=1;
> $b=&$a;
> foreach(array(2,3) as $b);
> echo "a=$a";
>
> // Print a=3
>
> Is it the behaviour expected
> in a foreach loop?
>
> JP
>
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com