Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56398 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1385 invoked from network); 18 Nov 2011 16:14:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2011 16:14:05 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:65386] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/30-06569-A4486CE4 for ; Fri, 18 Nov 2011 11:14:03 -0500 Received: by bkbzt4 with SMTP id zt4so3808333bkb.29 for ; Fri, 18 Nov 2011 08:13:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=wa9JX1vkNA/+XW6zYk27C7e06tukyt3n/dagfHeT02o=; b=mrbrfqy7oABf0rUGs1LqDNNG+sEoHRyr6PwLFXJRI8qo+PUBj4uFL7lC1ZtUrrpHkQ nwnraGkvAd1dcEqXiXCyWuGjnsTkmjSVNxsGBX+pFxk195w+Ipns/QFIaWM5v1MFWtoc ZSTK1af22Rct7pWpQCoDa9rbbZQ+GgrajINjQ= MIME-Version: 1.0 Received: by 10.205.134.143 with SMTP id ic15mr4081641bkc.45.1321632839402; Fri, 18 Nov 2011 08:13:59 -0800 (PST) Sender: ekneuss@gmail.com Received: by 10.205.37.205 with HTTP; Fri, 18 Nov 2011 08:13:59 -0800 (PST) In-Reply-To: References: Date: Fri, 18 Nov 2011 17:13:59 +0100 X-Google-Sender-Auth: wktqeiaVlabX6p12dHBKgQ9CXS4 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] array_key_exists with float keys (bug #60039) From: colder@php.net (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. >> >> Nikita >> >> [1]: https://bugs.php.net/bug.php?id=60039 >> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch