Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22164 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75849 invoked by uid 1010); 7 Mar 2006 05:21:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75834 invoked from network); 7 Mar 2006 05:21:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2006 05:21:00 -0000 X-Host-Fingerprint: 69.12.155.130 69-12-155-130.dsl.static.sonic.net Linux 2.4/2.6 Received: from ([69.12.155.130:1453] helo=pigeon.alphaweb.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 65/07-22029-C381D044 for ; Tue, 07 Mar 2006 00:21:00 -0500 Received: from localhost ([127.0.0.1] helo=stumpy) by pigeon.alphaweb.net with smtp (Exim 4.10) id 1FGU4l-0003oj-00; Mon, 06 Mar 2006 20:45:35 -0800 Message-ID: <002701c641a7$59f52620$7d051fac@stumpy> To: "Xuefer" Cc: , References: <440C7D6F.7030809@caedmon.net> <28139bc0603061902t2cccc154ie76e7ca62a7ed781@mail.gmail.com> Date: Mon, 6 Mar 2006 21:24:03 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] foreach, assigning to a reference, and E_NOTICE From: pollita@php.net ("Sara Golemon") >> 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. -Sara