Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19741 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54465 invoked by uid 1010); 26 Oct 2005 19:43:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54450 invoked from network); 26 Oct 2005 19:43:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2005 19:43:06 -0000 X-Host-Fingerprint: 69.64.38.41 bluga.net Linux 2.5 (sometimes 2.4) (4) Received: from ([69.64.38.41:42287] helo=bluga.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 4F/A8-22886-94CDF534 for ; Wed, 26 Oct 2005 15:43:05 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by bluga.net (Postfix) with ESMTP id AAD7921CAA4; Wed, 26 Oct 2005 14:44:08 -0500 (CDT) Received: from bluga.net ([127.0.0.1]) by localhost (bluga.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07175-04; Wed, 26 Oct 2005 14:44:08 -0500 (CDT) Received: from [129.93.125.28] (pcp062971pcs.unl.edu [129.93.125.28]) by bluga.net (Postfix) with ESMTP id C91FF21C1B2; Wed, 26 Oct 2005 14:44:07 -0500 (CDT) Message-ID: <435FDC41.30207@php.net> Date: Wed, 26 Oct 2005 14:42:57 -0500 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jani Taskinen CC: internals@lists.php.net References: <4e36d31d0510261018t639c472x9efaaf7af61a9ddb@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new using ClamAV at bluga.net Subject: Re: [PHP-DEV] Re: foreach with null From: cellog@php.net (Greg Beaver) Jani Taskinen wrote: > On Wed, 26 Oct 2005, Sebastian wrote: > > [clip] > >> Good code is code that's easy to debug (among other things). By >> removing the "Invalid argument supplied for foreach()" warning without >> providing mechanisms to turn it on, debugging code will be more >> difficult. > > [clip] > > You got to the point here. I'd like to see E_STRICT be used for this > if this NULL thing is accepted. Also, I found out recently something > that I didn't know about before and which I count as inconsistent: > > count() returns int(1). > > It would be nice that count() would also produce an E_STRICT notice > when passed something else than object or array. Or rather make > every single function and language construct to produce the E_STRICT > notice when passed wrong type of variable. amen, this behavior makes no sense even though sizeof() is an alias to count(). sizeof('this') and sizeof('this long thing') are both 1, which makes no sense. I would go so far as to say a E_NOTICE is more appropriate than E_STRICT - you should only be using count() for arrays/objects. Then Zend could remove the silly question from the cert example exam ;). Greg