Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24652 invoked by uid 1010); 7 Mar 2006 07:54:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24636 invoked from network); 7 Mar 2006 07:54:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2006 07:54:38 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:50866] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 07/0C-22029-D3C3D044 for ; Tue, 07 Mar 2006 02:54:38 -0500 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id k277sTkr032513; Tue, 7 Mar 2006 08:54:29 +0100 Date: Tue, 7 Mar 2006 08:53:34 +0100 (CET) X-X-Sender: derick@localhost To: Sara Golemon cc: Xuefer , sean@caedmon.net, internals@lists.php.net In-Reply-To: <002701c641a7$59f52620$7d051fac@stumpy> Message-ID: References: <440C7D6F.7030809@caedmon.net> <28139bc0603061902t2cccc154ie76e7ca62a7ed781@mail.gmail.com> <002701c641a7$59f52620$7d051fac@stumpy> X-Face: "L'&?Ah3MYF@FB4hU'XhNhLB]222(Lbr2Y@F:GE[OO;"F5p>qtFBl|yVVA&D{A(g3[C}mG:199P+5C'v.M/u@Z\![0b:Mv.[l6[uWl' MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] foreach, assigning to a reference, and E_NOTICE From: derick@php.net (Derick Rethans) On Mon, 6 Mar 2006, Sara Golemon wrote: > > > Can we throw an E_NOTICE when foreach targets a reference? (The other > > there's many way to use reference, not only in foreach. don't do > > reference unless u know it's really needed. > > > Sean's not so much referring to his own problem as (like you said) the > solution is a fairly simple matter of following strict coding practices. He's > trying to address the problem of unexperienced developers seeing this behavior > and (wrongly) reporting it as a bug, or worse, assuming PHP is just "broken" > and therefore shouldn't be used. > > That said, I'm not convinved this needs a notice, but I'm certainly not > against it. Perhaps we should split the difference with an E_STRICT. It *has* to be an E_STRICT because it's something related to language and possible semantic errors. E_NOTICE is not for that. However, I don't think that we should add this, as it's perfectly normal and expected behavior (albeit a bit weird). And indeed, some people might rely on this "feature". Derick