Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57705 invoked from network); 22 Oct 2009 16:49:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2009 16:49:21 -0000 Authentication-Results: pb1.pair.com header.from=richardkmiller@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=richardkmiller@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.213 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: richardkmiller@gmail.com X-Host-Fingerprint: 209.85.218.213 mail-bw0-f213.google.com Received: from [209.85.218.213] ([209.85.218.213:33242] helo=mail-bw0-f213.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/D3-21514-01D80EA4 for ; Thu, 22 Oct 2009 12:49:21 -0400 Received: by bwz5 with SMTP id 5so635244bwz.23 for ; Thu, 22 Oct 2009 09:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=f8Yo+8nuUHZg6RElm9sCpKEuxti+3ugq0J8v7xnKcpM=; b=tGMTPihQ1NUvyVoyifU9ekMdgKFFviKIKNtytV7T4EuD91hQZjkH8QFWMC+aksJHHY mb9KnpwtNtSEkZ2jJ/redzwAnA5APeijQBOaBuY45H/K3j4YbHwkUwD5qjHoFMuZsK4/ KZ8mUnmxfbImL1cd8h+DOslau7HCOgHxFkRng= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=EHzWHX4MC38IM/NO5Nz8fGwl6vOQDvpiBn5XMWJCE92oCj5lRc7F1DPElA2Cslllof 2oTQZNJ/x2TsGWZz2mMSLXNb9/eXIxiKwfzpPpp6AZf0THF9UODHhqkAZN1zeX3Lcmam fIjxRU93c0WJQgJWTCNt1po4YUG8Bm2L1VLJI= Received: by 10.204.141.18 with SMTP id k18mr9928563bku.139.1256230157696; Thu, 22 Oct 2009 09:49:17 -0700 (PDT) Received: from ?192.168.1.160? (69.169.140.26.provo.static.broadweavenetworks.net [69.169.140.26]) by mx.google.com with ESMTPS id 1sm2265955fkt.41.2009.10.22.09.49.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Oct 2009 09:49:16 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes In-Reply-To: <4AE07B61.7030308@lerdorf.com> Date: Thu, 22 Oct 2009 10:49:12 -0600 Cc: Antony Dovgal , internals@lists.php.net Content-Transfer-Encoding: 7bit Message-ID: <7D2CE34C-177D-47BD-B758-433FCEF6C733@gmail.com> References: <84898698-728C-44ED-BF7A-E0E02C111F68@gmail.com> <4AE00CE9.9050602@daylessday.org> <2FEC738F-A4EF-4853-8CC7-D4DAF97D892C@gmail.com> <4AE07B61.7030308@lerdorf.com> To: Rasmus Lerdorf X-Mailer: Apple Mail (2.1076) Subject: Re: [PHP-DEV] bug when using foreach with references? From: richardkmiller@gmail.com (Richard K Miller) > It is one of these things that make perfect sense when you think about > it a little bit. Yes, it catches some people, just like strpos() > returning character position 0 on a first-char match catches some > people. There is no way to fix things like these without completely > breaking things. If we had strpos not use 0-based string positions or > if we arbitrarily broke references after loops, all sorts of other > things would start breaking and no longer make sense. > > -Rasmus Rasmus, Thanks for your reply. With respect, this seems to be in a different class from matching strings with character position 0, IMO. What about unsetting the iterator before foreach() looping begins? The iterator is altered anyway, so would this prevent it from being "attached" to previous foreach() iterations? Best, Richard