Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18954 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23128 invoked by uid 1010); 15 Sep 2005 10:38:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23113 invoked from network); 15 Sep 2005 10:38:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2005 10:38:49 -0000 X-Host-Fingerprint: 195.225.34.5 fw01.axit.nl Received: from ([195.225.34.5:23114] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 81/1E-41173-93F49234 for ; Thu, 15 Sep 2005 06:38:49 -0400 Message-ID: <81.1E.41173.93F49234@pb1.pair.com> To: internals@lists.php.net Date: Thu, 15 Sep 2005 12:35:48 +0200 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 195.225.34.5 Subject: references in arrays From: r.korving@xit.nl ("Ron Korving") Hi, For performance' sake, I have to know if this is true: Is it the case that when I do this: array(0,1,2), "two" => array(4,5,6)); $one = $array["one"]; ?> That $one is not a copy, but a reference to $array["one"] and will only become a copy when I alter the contents of $one? I know this is the case for regular variables, but does this also go for contents of arrays? If not, I need to use the ampersand like I used to. But if it really is just a reference, that would be good to know as I shouldn't be using the ampersand at all (mistakingly thinking it's a performance advantage when it's actually not). Thanks, Ron