Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68556 invoked by uid 1010); 25 Oct 2005 16:49:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68541 invoked from network); 25 Oct 2005 16:49:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Oct 2005 16:49:28 -0000 X-Host-Fingerprint: 69.56.217.178 unknown Linux 2.4/2.6 Received: from ([69.56.217.178:51097] helo=coggeshall.org) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 78/0B-22886-8126E534 for ; Tue, 25 Oct 2005 12:49:28 -0400 Received: from [192.168.1.69] (ool-4576ffa6.dyn.optonline.net [69.118.255.166]) (authenticated bits=0) by coggeshall.org (8.12.8/8.12.8) with ESMTP id j9PFDoVP006694 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 25 Oct 2005 10:13:55 -0500 To: Antony Dovgal Cc: Marcus Boerger , internals@lists.php.net In-Reply-To: <435D6401.6070003@zend.com> References: <425333877.20051025002259@marcus-boerger.de> <435D6401.6070003@zend.com> Content-Type: text/plain Date: Tue, 25 Oct 2005 12:49:18 -0400 Message-ID: <1130258958.8223.14.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 (2.0.4-6) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] foreach with null From: john@coggeshall.org (John Coggeshall) +1 as well if and only if this applies to IS_NULL On Tue, 2005-10-25 at 02:45 +0400, Antony Dovgal wrote: > I'd say silently ignoring it and moving along is fine here. > Only if the var IS_NULL, but this is the case. > > So I'm +1. > > On 25.10.2005 02:22, Marcus Boerger wrote: > > Hello internals, > > > > i would like to change foreach a tiny bit. Actually i don't like the > > warning when using foreach with null. > > > > marcus@zaphod /usr/src/php-cvs $ php -r '$n=NULL; foreach($n as $v);' > > make: `sapi/cli/php' is up to date. > > > > Warning: Invalid argument supplied for foreach() in Command line code on line 1 > > marcus@zaphod /usr/src/php-cvs $ php -r 'foreach(NULL as $v);' > > make: `sapi/cli/php' is up to date. > > > > Warning: Invalid argument supplied for foreach() in Command line code on line 1 > > > > The way we use NULL in PHP should result in no warning here. The patch for > > this can be found here: > > http://php.net/~helly/php/ext/ze2/ze2-foreach-null-20051025.diff.txt > > It was made with head but applies to 5.1 as well. > > > > Any opinions? > > > -- > Wbr, > Antony Dovgal >