Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26906 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12751 invoked by uid 1010); 12 Dec 2006 09:43:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12735 invoked from network); 12 Dec 2006 09:43:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2006 09:43:17 -0000 Authentication-Results: pb1.pair.com header.from=mp@webfactory.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mp@webfactory.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain webfactory.de from 195.227.108.51 cause and error) X-PHP-List-Original-Sender: mp@webfactory.de X-Host-Fingerprint: 195.227.108.51 wfserver02.wf-ppr.de Windows 2000 SP2+, XP SP1 (seldom 98 4.10.2222) Received: from [195.227.108.51] ([195.227.108.51:56115] helo=wfserver02.wf-ppr.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/AE-19935-1997E754 for ; Tue, 12 Dec 2006 04:43:16 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Tue, 12 Dec 2006 10:42:38 +0100 Message-ID: <00A2E2156BEE8446A81C8881AE117F1949C843@companyweb> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: foreach with referenced values Thread-Index: Accd0dwPXgM/xxgtQcWrhXVFyaBvng== To: Subject: foreach with referenced values From: mp@webfactory.de ("Matthias Pigulla") Hi internals, please consider: Result: 5.2.0 Array ( [0] =3D> * [1] =3D> b ) Same with 5.1.4 and 5.1.6. I suppose that using foreach and referencing the values turns the elements in $a into references, $b is a copy of the array containing *references* and thus chaning the value of the first element in $a is visible in $b because both arrays reference the the same value? When moving the $b assignment before the foreach, everything works as expected. Is this really intended behaviour? Kind regards, mp.