Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19757 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55208 invoked by uid 1010); 27 Oct 2005 10:10:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55192 invoked from network); 27 Oct 2005 10:10:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2005 10:10:26 -0000 X-Host-Fingerprint: 195.197.172.115 gw01.mail.saunalahti.fi Linux 2.4/2.6 Received: from ([195.197.172.115:57079] helo=gw01.mail.saunalahti.fi) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2F/D9-22886-197A0634 for ; Thu, 27 Oct 2005 06:10:25 -0400 Received: from nest.netphobia.fi (YZDCXXXI.dsl.saunalahti.fi [85.76.35.232]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id D4F44F9266; Thu, 27 Oct 2005 13:10:19 +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 j9RAAKIF015022; Thu, 27 Oct 2005 13:10:20 +0300 Received: from localhost (jani@localhost) by nest.netphobia.fi (8.13.1/8.13.1/Submit) with ESMTP id j9RAAKMv015019; Thu, 27 Oct 2005 13:10:20 +0300 X-Authentication-Warning: nest.netphobia.fi: jani owned process doing -bs Date: Thu, 27 Oct 2005 13:10:20 +0300 (EEST) Reply-To: Jani Taskinen To: Ilia Alshanetsky cc: internals@lists.php.net In-Reply-To: <435FF414.3000303@prohost.org> Message-ID: References: <4e36d31d0510261018t639c472x9efaaf7af61a9ddb@mail.gmail.com> <435FDC41.30207@php.net> <435FF414.3000303@prohost.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [PHP-DEV] Re: foreach with null From: sniper@iki.fi (Jani Taskinen) On Wed, 26 Oct 2005, Ilia Alshanetsky wrote: > > Greg Beaver wrote: >> 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. > > Actually this result makes perfect sense since type conversion changes > string into array('your string') and does a count of that, which is 1. This is yet another magic type casting I'd like to get rid of.. Strict is not always bad, mmkay? :) I got bitten by this (unexpected?) behaviour of count() myself this week. I must have been strict in my mind and not passed anything but arrays to it before this. :) --Jani