Re: [PHP4BETA] return references branch merged into the main repository

From: Date: Thu, 16 Dec 1999 11:15:49 +0000
Subject: Re: [PHP4BETA] return references branch merged into the main repository
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-7996@lists.php.net to get a copy of this message
When you assign to a variable from a function which returns a ref, does it first unbind the variable from any previous refs? e.g. $a=array(1,2,3,4,5); function &iterate($a) { if (list($k)=each($a)) { $a[$k] = $a[$k]*2; return &$a[$k]; } $r=0; return &$r; } reset($a); while($e=&iterate($a)) { echo "New value is $e\n"; } Will this leave $a with the values (2,4,6,8,10) or (10,10,10,10,10)? -------------------------------------------------------------------- Duncan McIntyre Director Emarketeers Ltd Priory Gate, Priory Road Dunstable, Beds. LU5 4HR England Duncan@Emarketeers.com (+44) 1582 534 324 - Office (+44) 7957 136 369 - Mobile

« previous php.version4 (#7996) next »