Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26907 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15012 invoked by uid 1010); 12 Dec 2006 09:55:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14997 invoked from network); 12 Dec 2006 09:55:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2006 09:55:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:5814] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/0F-19935-05C7E754 for ; Tue, 12 Dec 2006 04:55:01 -0500 Received: (qmail 31167 invoked from network); 12 Dec 2006 09:52:53 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 12 Dec 2006 09:52:53 -0000 Message-ID: <457E7C47.80200@zend.com> Date: Tue, 12 Dec 2006 12:54:15 +0300 User-Agent: Thunderbird 1.5.0.8 (X11/20061025) MIME-Version: 1.0 To: Matthias Pigulla CC: internals@lists.php.net References: <00A2E2156BEE8446A81C8881AE117F1949C843@companyweb> In-Reply-To: <00A2E2156BEE8446A81C8881AE117F1949C843@companyweb> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] foreach with referenced values From: antony@zend.com (Antony Dovgal) On 12/12/2006 12:42 PM, Matthias Pigulla wrote: > Hi internals, > > please consider: > > 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