Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91128 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85199 invoked from network); 8 Feb 2016 17:49:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2016 17:49:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@mprelu.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@mprelu.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mprelu.de from 74.201.84.163 cause and error) X-PHP-List-Original-Sender: me@mprelu.de X-Host-Fingerprint: 74.201.84.163 sender163-mail.zoho.com Received: from [74.201.84.163] ([74.201.84.163:25701] helo=sender163-mail.zoho.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/C7-36326-235D8B65 for ; Mon, 08 Feb 2016 12:49:38 -0500 Received: from [192.168.0.5] (bcdfe029.skybroadband.com [188.223.224.41]) by mx.zohomail.com with SMTPS id 1454953774962791.7590563291925; Mon, 8 Feb 2016 09:49:34 -0800 (PST) To: internals@lists.php.net References: <56B8CB06.6020603@rodas.me> <56B8D20D.9040106@fischer.name> Message-ID: <56B8D52C.30408@mprelu.de> Date: Mon, 8 Feb 2016 17:49:32 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56B8D20D.9040106@fischer.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Zoho-Virus-Status: 1 Subject: Re: [PHP-DEV] Proposal for a new array function From: me@mprelu.de (Matt Prelude) On 08/02/16 17:36, Markus Fischer wrote: > Hi, > > On 08.02.16 18:06, Cesar Rodas wrote: >>>> return array_keys($arr) !== range(0, count($arr) - 1); >> `array_keys($array) === range(0, count($array)-1)` > That approach would fall flat when the numeric keys are not consecutive: > > $array = [1=>"a", 3=>"b"]; > > Disclaimer: AFAIK complete goal of the function wasn't yet stated, thus > this could be considered /acceptable/. > > cheers, > - Markus > I would read 'has_numeric_keys' as accepting any keys of type int or float. Not sure if this was the intention, but would be my expectation from the method name. - Matt.