Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19758 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56625 invoked by uid 1010); 27 Oct 2005 10:12:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56610 invoked from network); 27 Oct 2005 10:12:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2005 10:12:49 -0000 X-Host-Fingerprint: 195.197.172.115 gw01.mail.saunalahti.fi Linux 2.4/2.6 Received: from ([195.197.172.115:58023] helo=gw01.mail.saunalahti.fi) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 74/2A-22886-128A0634 for ; Thu, 27 Oct 2005 06:12:49 -0400 Received: from nest.netphobia.fi (YZDCXXXI.dsl.saunalahti.fi [85.76.35.232]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id CD8A0F92C0; Thu, 27 Oct 2005 13:12:42 +0300 (EEST) Received: from nest.netphobia.fi (nest.netphobia.fi [127.0.0.1]) by nest.netphobia.fi (8.13.1/8.13.1) with ESMTP id j9RAChch015034; Thu, 27 Oct 2005 13:12:43 +0300 Received: from localhost (jani@localhost) by nest.netphobia.fi (8.13.1/8.13.1/Submit) with ESMTP id j9RAChpC015031; Thu, 27 Oct 2005 13:12:43 +0300 X-Authentication-Warning: nest.netphobia.fi: jani owned process doing -bs Date: Thu, 27 Oct 2005 13:12:43 +0300 (EEST) Reply-To: Jani Taskinen To: Jochem Maas cc: Ilia Alshanetsky , Marcus Boerger , internals@lists.php.net In-Reply-To: <4360057C.9010705@iamjochem.com> Message-ID: References: <425333877.20051025002259@marcus-boerger.de> <435FF772.70206@prohost.org> <4360057C.9010705@iamjochem.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [PHP-DEV] foreach with null From: sniper@iki.fi (Jani Taskinen) 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. :) --Jani