Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56402 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7827 invoked from network); 18 Nov 2011 16:46:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2011 16:46:08 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.161.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:59154] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/71-06569-FCB86CE4 for ; Fri, 18 Nov 2011 11:46:07 -0500 Received: by faan2 with SMTP id n2so4852728faa.29 for ; Fri, 18 Nov 2011 08:46:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CBm2sOpwzgzxjE2UDlMs2tSaLwaWxZp9L5bQH2L3NMM=; b=jTAI9oDbIFLttn0tLLgC0zXE2w0biOU0wYFyCOAwvYWE/7rGSw3yxKBoZCLvTvDVjk A0y4hHAlNHX3XWxsVbOa7lDPtbgcuqugK35NgMvo6O7WL/ld+HjlKFX9TADbySuPjJFe alfnUDYe4X39+9YkoMDFx/m5ldRwwS30UPaLQ= MIME-Version: 1.0 Received: by 10.152.123.144 with SMTP id ma16mr2506252lab.32.1321634763788; Fri, 18 Nov 2011 08:46:03 -0800 (PST) Received: by 10.152.26.111 with HTTP; Fri, 18 Nov 2011 08:46:03 -0800 (PST) In-Reply-To: References: Date: Fri, 18 Nov 2011 17:46:03 +0100 Message-ID: To: Felipe Pena Cc: Etienne Kneuss , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] array_key_exists with float keys (bug #60039) From: nikita.ppv@googlemail.com (Nikita Popov) On Fri, Nov 18, 2011 at 5:37 PM, Felipe Pena wrote: > 2011/11/18 Etienne Kneuss : >> 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. Thanks for your answers This is not about whether or not PHP's current behavior towards float keys is good or not - it is *existing* behavior. This is about making isset($array[$key]) and array_key_exists($key, $array) behave the same (apart from the null value difference). We could obviously make the unification work the other way around, i.e. remove float, bool, resource and null support for array keys, but I am sure that this will only be a call for the angry mob, which expected that their 14.0 key behaves just like a 14 one (which kinda makes sense in a PHP environment). Nikita