Re: foreach with referenced values

From: Date: Tue, 12 Dec 2006 09:54:15 +0000
Subject: Re: foreach with referenced values
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-26907@lists.php.net to get a copy of this message
On 12/12/2006 12:42 PM, Matthias Pigulla wrote:
Hi internals, please consider: <?php print PHP_VERSION . "\n"; $a = array('a', 'b'); foreach ($a as &$ref) ; $b = $a; $a[0] = '*'; print_r($b); ?> Result: 5.2.0 Array (
    [0] => *
    [1] => b
)
Did you try a snapshot? 5.2.1-dev Array ( [0] => a [1] => b ) -- Wbr, Antony Dovgal

« previous php.internals (#26907) next »