Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19756 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44473 invoked by uid 1010); 27 Oct 2005 09:58:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44458 invoked from network); 27 Oct 2005 09:58:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2005 09:58:08 -0000 X-Host-Fingerprint: 66.249.82.196 xproxy.gmail.com Linux 2.4/2.6 Received: from ([66.249.82.196:61908] helo=xproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F5/38-22886-0B4A0634 for ; Thu, 27 Oct 2005 05:58:08 -0400 Received: by xproxy.gmail.com with SMTP id s8so678331wxc for ; Thu, 27 Oct 2005 02:58:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=J3357kVtBWpwc8tXHygv3KIcDKjwuicbiaQqPms9RHvnOXGiyMsoZgOKyaXb1jc4DpXNw1ro1zMKnKqtc7kipoNHvgQXoHYxTIwvEwJugQvbxBEXAqwqkW6ga9Tgw1QWI9e7qhjJytgjpLCEwHlrt54wphqibp36bkP3k9JuEYA= Received: by 10.70.15.11 with SMTP id 11mr1050978wxo; Thu, 27 Oct 2005 02:58:04 -0700 (PDT) Received: by 10.70.41.20 with HTTP; Thu, 27 Oct 2005 02:58:04 -0700 (PDT) Message-ID: <7f3ed2c30510270258i6489024cm4e2293f2c8c891b5@mail.gmail.com> Date: Thu, 27 Oct 2005 11:58:04 +0200 To: Derick Rethans Cc: internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7965_19577258.1130407084923" References: <425333877.20051025002259@marcus-boerger.de> <435FF772.70206@prohost.org> Subject: Re: [PHP-DEV] foreach with null From: hannes.magnusson@gmail.com (Hannes Magnusson) ------=_Part_7965_19577258.1130407084923 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 10/27/05, Derick Rethans wrote: > > On Wed, 26 Oct 2005, Ilia Alshanetsky wrote: > > > IMHO this is a bad idea, if you really wanted to support NULL in a > > particular case you, as a developer could do: > > php -r '$n=3DNULL; foreach((array)$n as $v);' > > > > Making NULL usage transparent where array is expects will lead to > > difficult to debug code. > > > > -1 for removing the warning. > > Yes, I agree, we should not remove this warning. > > Derick +1 on *not* removing the warning. I can't see any reson why it should be removed. php -r '$foo =3D array(2, 3, 4); echo substr("foobar", $foo). "\n";' currently prints "oobar". Would like to see, as Jani suggested, E_STRICT notice thrown when wrong data type is passed to a function/language construct. - Hannes ------=_Part_7965_19577258.1130407084923--