Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16340 invoked from network); 9 Feb 2016 01:15:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2016 01:15:22 -0000 Received: from [127.0.0.1] ([127.0.0.1:9155]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 85/00-15491-9AD39B65 for ; Mon, 08 Feb 2016 20:15:21 -0500 Authentication-Results: pb1.pair.com header.from=marceloeverson.rm@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marceloeverson.rm@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.174 as permitted sender) X-PHP-List-Original-Sender: marceloeverson.rm@gmail.com X-Host-Fingerprint: 209.85.160.174 mail-yk0-f174.google.com Received: from [209.85.160.174] ([209.85.160.174:35926] helo=mail-yk0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/00-15491-A2939B65 for ; Mon, 08 Feb 2016 19:56:11 -0500 Received: by mail-yk0-f174.google.com with SMTP id z7so94413556yka.3 for ; Mon, 08 Feb 2016 16:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=DhSXWHvGgsbdBL36ydW9SqFYOVDeUeDrhoKIe2LOCVo=; b=Jys4UJ8tJkECFIxGt9SLs3pSvWFTRUJmuNhnWLkyFe2aYySz124FAYCzRYDLRvprsz zR9TnktKkYlVG5zxgrBZlhXl+OQFKf3vfMgC5Ulh6M0YAns4e25FJrmb9ix5HSsELlLg i8ZTOkybNW0jwlJilMsHmPGkvABTSLpAceq7H/f2O/dU7yOt6TRMdI4puXlEuqin8MOH HqW5kGjzCEIRMRez8q3EDE9HPuMucXEAsyP/3P9NYGAmS8wkn+7RPiMlWnxsp1SeoIzu hAFQy+CW+JG+SACP+KQLOrgvazoi86FlxNkPv64vAwSIWAR4C3unGgvBEeLF4JeHJjZP +nZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=DhSXWHvGgsbdBL36ydW9SqFYOVDeUeDrhoKIe2LOCVo=; b=G2+uujL+SZFlB+o1SgqzX0hPzSe/Dwk4F3kZ3/IafyFcuHcgjqA/G1d9QC41O0fSTz aWAoyuPtg4i+3iV6yJJjktDxzJ7imSTW3bE+qxz9mM0EcbOknq1HpIm/EoTSnz5++npQ AnK/Jc7lY2jlE/5tSXVABcYdw+AIpPhI0dZ9DhQ7w76yj0xTyz8g8EtILbWTpoxALIA7 3LVz7t/hK3lR3+wmnnLq0HwxxaS2oR0pVENJSa0f1iO+brp2+rECeUlBgm+EGCzHVrmE 4+u0YeUklsd77Zs6L4ePCJbEJiM0WQ/pFLNBPnbGL8aronJhIHUXf3eN9lMiHg/D7dUz GpyQ== X-Gm-Message-State: AG10YOSO3CdDT79pP5LPZq8+Ml7WQZ/1kLLwHaJEaGuhdZCG/fE62281vH5Zk9VxqRV3R8bBCS672cHnzXB+qQ== MIME-Version: 1.0 X-Received: by 10.37.2.194 with SMTP id 185mr16578976ybc.44.1454979368318; Mon, 08 Feb 2016 16:56:08 -0800 (PST) Received: by 10.13.204.74 with HTTP; Mon, 8 Feb 2016 16:56:08 -0800 (PST) Date: Mon, 8 Feb 2016 22:56:08 -0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a113d3ee067827c052b4bc877 Subject: Re: Proposal for a new array function From: marceloeverson.rm@gmail.com (marcelo everson Ramos) --001a113d3ee067827c052b4bc877 Content-Type: text/plain; charset=UTF-8 On the proposal for a new function to array that could be called has_numeric_keys I believe would be the most appropriate as the name of the function as well as its functionality. I believe that the creation of a typo checking function would be more interesting. In other languages array contains only numerical keys while hash have arbitrary keys. So creating a function is_hash as would be the case. Sample: $arr = [1, 2, 3]; is_hash (arr $) // -> false $hash = [ '23' => 'FOO', 'baz' => 12 'bar' => 89]; is_hash ($ hash) // -> true --001a113d3ee067827c052b4bc877--