Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77809 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93020 invoked from network); 7 Oct 2014 16:42:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2014 16:42:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=mathiasgrimm@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mathiasgrimm@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.180 as permitted sender) X-PHP-List-Original-Sender: mathiasgrimm@gmail.com X-Host-Fingerprint: 209.85.213.180 mail-ig0-f180.google.com Received: from [209.85.213.180] ([209.85.213.180:52792] helo=mail-ig0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/1D-30869-BD714345 for ; Tue, 07 Oct 2014 12:42:04 -0400 Received: by mail-ig0-f180.google.com with SMTP id uq10so5075151igb.7 for ; Tue, 07 Oct 2014 09:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y0PkoMzfXHM6EjUvRVt9zxY79JGBaISEOuXE4pUvzRA=; b=tULQ+dlzMVPEXdhWkblEPSl9FcWbj44GrRF5JMYzAnDAyB/L1kFz9coebMOyFfBOED pIZkHZ2pTjnkKuTeFNjsqAQzLGAmylgd8XYYkZasGJylekn90irNwXKfk5GJif+igfCV +20yOWuo8iLd9zfZUrKA66dWCoxfVctaAyjr8taT7ECNyfin7mx6FhPS2EKUTNDZah5p U9WY3CjD57b5Wf0w1MAFw93HpD94pjszXRMSXIEVV2yrbrGqTgB4BaGBsqoF9TzI/BkD VWVXNOtREgIFxmHPrIvL8Qi0J1sMLOJH8DIKcPDrpAmpoFJhC4RMubWDJ1MVzQU++gcR 0hIw== MIME-Version: 1.0 X-Received: by 10.42.39.7 with SMTP id f7mr6283329ice.93.1412700121050; Tue, 07 Oct 2014 09:42:01 -0700 (PDT) Received: by 10.64.76.136 with HTTP; Tue, 7 Oct 2014 09:42:00 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Oct 2014 17:42:00 +0100 Message-ID: To: Matthew Fonda Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf30223ca7e3b8da0504d7e033 Subject: Re: [PHP-DEV] ArrayPath From: mathiasgrimm@gmail.com (Mathias Grimm) --20cf30223ca7e3b8da0504d7e033 Content-Type: text/plain; charset=UTF-8 For international user this makes more sense because the "'" or the '"' are sensitive keys that needs two interactions instead of just one... so for typing something like $_POST['asasdasd']['asdasd']['asdasd'] is sometimes a bit annoying but it could be solved having 2 keyboard layouts (my case) As I said before, this is not something that is going to change the php direction, however many developer would get very happy. I have never seen this in other languages but my knowledge is not very expressive as well. On Tue, Oct 7, 2014 at 5:36 PM, Mathias Grimm wrote: > Great! That solves 75% of the problem. > > Still accessing index using "/" (or other separator) would be very handy > > $c = $_POST::path('a/b/c', 'def') > $c = $_POST::('a/b/c', 'def') > $c = $_POST@('a/b/c', 'def') > $c = $_POST::at('a/b/c', 'def') > > > I am not really creative now, but the part I would like to highlight is > the feature and not really the syntax. > > > > > On Tue, Oct 7, 2014 at 5:21 PM, Matthew Fonda wrote: > >> On Tue, Oct 7, 2014 at 9:05 AM, Mathias Grimm >> wrote: >> >>> Hi, >>> I would like to suggest something for php like a class I am using >>> >>> https://github.com/mathiasgrimm/arraypath >>> >>> The reason is to access arrays like this: >>> >>> $idx3 = ArrayPath::get('idx1/idx2/idx3', $_POST, 'myDefaultValue'); >>> >>> >>> Regards, >>> Mathias >>> >> >> Hi Mathias, >> >> The new null coalesce operator in PHP 7 achieves what you're looking for >> here. See https://wiki.php.net/rfc/isset_ternary >> >> Best regards, >> --Matthew >> > > --20cf30223ca7e3b8da0504d7e033--