Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56400 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5045 invoked from network); 18 Nov 2011 16:37:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2011 16:37:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:56479] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/E0-06569-CC986CE4 for ; Fri, 18 Nov 2011 11:37:33 -0500 Received: by ggnk1 with SMTP id k1so1784590ggn.29 for ; Fri, 18 Nov 2011 08:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=pdU4V6ukQBNXOMOPS+y6sXAsn/YyuKpbD8m/EQzyiss=; b=Kq3mDe9e/eLuwmpczs5roioIHiOkRW/DEa18vfRqpo904VH+S72Rm4VN9wCtDjrrS9 an7xIoC9HkKxfeQTC/+Qdq7Fd6mTCQPzh8JQ++o6+1oS7QTTLxUkxLQhI6cYmpzIIFmn w7mPwTiuQWDFWtbsvET9z/P4Zu7/fzPkG0/yg= Received: by 10.68.62.136 with SMTP id y8mr10208515pbr.87.1321634249070; Fri, 18 Nov 2011 08:37:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.44.5 with HTTP; Fri, 18 Nov 2011 08:37:08 -0800 (PST) In-Reply-To: References: Date: Fri, 18 Nov 2011 14:37:08 -0200 Message-ID: To: Etienne Kneuss Cc: Nikita Popov , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] array_key_exists with float keys (bug #60039) From: felipensp@gmail.com (Felipe Pena) 2011/11/18 Etienne Kneuss : > Hi, > > On Fri, Nov 18, 2011 at 16:41, Nikita Popov wrote: >> *push* >> >> On Fri, Nov 11, 2011 at 10:40 PM, Nikita Popov >> wrote: >>> Hi internals! >>> >>> I'd like to get some attention to bug #60039 [1]. It is about the >>> behavior of array_key_exists with "unusual" keys like floats, bools >>> and resources. Currently array_key_exists throws a warning if such a >>> key is passed. isset() on the other hand (and native array accesses in >>> general) treat them as valid keys, with floats being converted to ints >>> and bools and resources treated just like ints. >>> >>> I would like to see array_key_exists behave consistent with >>> isset($array[$key]) / $array[$key]. The bug has a patch attached that >>> does this. >>> >>> I don't think that this change has any BC impact as it only *removes* warnings. > > To me, it feels similar to the Array->String conversion: > It is one of those implicit conversions that is almost always indicating a bug. > > Therefore I would rather have both throw warnings than none of them. > > So -1 from me for the proposed unification. > Same opinion here. I do prefer not having such implict data repair. -- Regards, Felipe Pena