Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91115 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59363 invoked from network); 8 Feb 2016 15:25:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2016 15:25:44 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.50 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:36189] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/E2-36326-373B8B65 for ; Mon, 08 Feb 2016 10:25:40 -0500 Received: by mail-wm0-f50.google.com with SMTP id p63so118675975wmp.1 for ; Mon, 08 Feb 2016 07:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=FinDmfxskNFJhf58ht+14Stb2OikMM4kg5M+IbtlZLI=; b=U0zqwlptRNWoW2mkwgzpi5JeiBVDfWpKLy/Ga7afnjFNo7fYAHaebS4XKN1saSZu1Z /TXevEZ38XlLy+OvazvF1IWMBrGm+NByDNfdejxIKDqSdqtYwBFjPJD+ez3m1cMQ4ijB QsGXxnJ1cjowmN79XJbCUDcRSNxyO5UpaOxwkcDlyzHiVz6x9hST3Xjez1eMP/MeW3g0 y8Z/sadHW5A2hSt4cF7XBG011WaDDN4xdmirGgWbsGtU2ZofirWxlFIY/JigcJKRuez4 aPxiqK4qzgaNg/zbsWWfzG8h3I3e7CEOcstBLixZeHTaEsLB4tpPHsyIpYlLY4VWnamd Saqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=FinDmfxskNFJhf58ht+14Stb2OikMM4kg5M+IbtlZLI=; b=Q16WO19nq1BSn/lX0U0w+PXN4AQOBlzDWtzA6cEeCKpF6SJP6c5DERP5QY6FnJVlwF Y42BIq4z9EAlul2Mw2vHLIRMIZmfULNR3HTDCekLyMelnajNEO8Yx7CYswuy6WK+AK6g OdS/rxZ4yyD5ZNxxAcJ0elIJY1lEl002TKt6CcvnxJ0QCqsTqh3r8hi9aMpQvL7C3f1b BC988P0/ub+626U2qMuo0FESV8syEV9S80yLKU3J5ATd0Cf7NhshdG/CjEodh6/3zb31 dNqZNbV0pbA7ISVnVXXTCabsmDh5iNqPcj5Em1bw7EMCk87spGS56U5Oivz1//CQ+/yw c6EA== X-Gm-Message-State: AG10YORPsXr7i47Q882tSGtMdohTRIwRQUukR3vOQLVNXHiYLOzZys0+r/8v6lTpUZBJBg== X-Received: by 10.194.20.105 with SMTP id m9mr27867123wje.161.1454945136798; Mon, 08 Feb 2016 07:25:36 -0800 (PST) Received: from [192.168.0.152] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id jc7sm30347343wjb.33.2016.02.08.07.25.36 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Feb 2016 07:25:36 -0800 (PST) To: internals@lists.php.net References: Message-ID: <56B8B31A.2030509@gmail.com> Date: Mon, 8 Feb 2016 15:24:10 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal for a new array function From: rowan.collins@gmail.com (Rowan Collins) Matthew Setter wrote on 08/02/2016 14:32: > I want to propose a new PHP array method, called has_numeric_keys (or > something similar/better), that would have the following method signature: > > bool has_numeric_keys(array $array) I like it. I also suspect it could be implemented very efficiently in core, at least for certain special cases, which is a good reason not to just leave it in userland. For instance, as I understand it, some arrays in ZE3 (PHP7) are "packed" if they consist of (mostly?) sequential integers; any such array could instantly return true for this function. While on the other side, a polyfill with identical semantics but worse behaviour would be easy to provide as a composer package, reducing BC concerns. It would need an RFC, but that shouldn't be too hard to get drafted in this case. https://wiki.php.net/rfc/howto Regards, -- Rowan Collins [IMSoP]