Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71997 invoked by uid 1010); 27 Oct 2005 10:50:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71982 invoked from network); 27 Oct 2005 10:50:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2005 10:50:05 -0000 X-Host-Fingerprint: 194.109.193.120 unknown Linux 2.4/2.6 Received: from ([194.109.193.120:35892] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 4E/DB-22886-CD0B0634 for ; Thu, 27 Oct 2005 06:50:05 -0400 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id 23D9F176007; Thu, 27 Oct 2005 12:50:04 +0200 (CEST) Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (moulin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28507-01; Thu, 27 Oct 2005 12:50:01 +0200 (CEST) Received: from [192.168.1.16] (bspr.xs4all.nl [194.109.161.228]) by mx1.moulin.nl (Postfix) with ESMTP id A25CF175F99; Thu, 27 Oct 2005 12:50:01 +0200 (CEST) Message-ID: <4360B0D5.5080202@iamjochem.com> Date: Thu, 27 Oct 2005 12:49:57 +0200 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jani Taskinen Cc: Ilia Alshanetsky , Marcus Boerger , internals@lists.php.net References: <425333877.20051025002259@marcus-boerger.de> <435FF772.70206@prohost.org> <4360057C.9010705@iamjochem.com> In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at moulin.nl Subject: Re: [PHP-DEV] foreach with null From: jochem@iamjochem.com (Jochem Maas) Jani Taskinen wrote: > On Thu, 27 Oct 2005, Jochem Maas wrote: > >> advanced code should be checking vars properly before using them and, >> well, >> for any given foreach loop there is often enough an 'if >> (!count($array))'-like >> statement to take care of the 'empty' case. and in cases when speed is >> very important > > > ..and where count() magically returns 1 f.e. for FALSE. :) > So really you can't rely on that. :) true - although personally I always do if(is_array($r) && count($r)) in such cases. so it seems that there is inconsistency regardless of whether the warning is removed or not. out of interest what are the ramifications for SPL and simpleXML if the warning is not dropped? > > --Jani >