Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14694 invoked from network); 3 Sep 2012 17:37:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2012 17:37:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.133 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.133 oxmail.registrar-servers.com Received: from [64.22.89.133] ([64.22.89.133:55676] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/03-20751-CDAE4405 for ; Mon, 03 Sep 2012 13:37:32 -0400 Received: from [192.168.0.200] (5ad3285b.bb.sky.com [90.211.40.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 656517580DB; Mon, 3 Sep 2012 13:37:28 -0400 (EDT) Message-ID: <5044EAB4.40003@ajf.me> Date: Mon, 03 Sep 2012 18:36:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Sherif Ramadan CC: Derick Rethans , Laruence , Jared Williams , internals@lists.php.net References: <20120902230741.TSGJ23973.aamtaout03-winn.ispmail.ntl.com@p2> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Foreach list behaviour From: ajf@ajf.me (Andrew Faulds) On 03/09/12 18:35, Sherif Ramadan wrote: > On Mon, Sep 3, 2012 at 4:20 AM, Derick Rethans wrote: >> Ew, that's quite nasty (in both cases). Is there a way how we could turn >> those into a notice or so? >> >> cheers, >> Derick >> > Sorry, hit reply instead of reply-all... > > list($a,$b) = 1; > var_dump($a,$b); > /* > NULL > NULL > */ > > This doesn't throw notices anywhere else... why should it throw > notices in foreach? I guess the only logical answer would be to notify > you if you were using scalar values with foreach and list, but then we > don't notify you if you're using scalar values with list anywhere else > in the language anyway. I'm starting to see huge inconsistencies with > how list is being implemented in foreach. > Possibly more importantly, since 1 should cast to, er, [1] (I think...), why is $a === NULL? -- Andrew Faulds http://ajf.me/