Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91272 invoked from network); 7 Oct 2014 16:36:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2014 16:36:12 -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.171 as permitted sender) X-PHP-List-Original-Sender: mathiasgrimm@gmail.com X-Host-Fingerprint: 209.85.213.171 mail-ig0-f171.google.com Received: from [209.85.213.171] ([209.85.213.171:62839] helo=mail-ig0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/AC-30869-A7614345 for ; Tue, 07 Oct 2014 12:36:11 -0400 Received: by mail-ig0-f171.google.com with SMTP id h15so4448398igd.10 for ; Tue, 07 Oct 2014 09:36:07 -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=PqvcEudnq2so3uF4+pxyOK88NF57Qe7ugExKiKT+uZg=; b=NfRxMyJptjBfkAOIjfhsxlic+76QiRD5C51FHZ9ncQutlxmhd6ZWSFwi8Y8Q2Z7tvk 0yXfgLq4Quei28w+kAmBTPHeoE8H4sEiM20u2D1gEUXJFwG7NbWwZcW+JV4+dUG8VAXO dEQitqut8hNEACwL1HfRLzS8QTh8/d/KWSHKLe3PgtAgP885wmTgHHZopW3Auo/3zEGy mu0y+2LI1HsvOBIEWpEA4CHvdeL4y5zD9iMAQrNdbkNkXoxyg0jzqfibq21jAb/Ukj3w yr9r5RyCs4+M19gFEpfdAdVF+TtFngizCCbBZZeqVEACtr5HJysf8LY4n23+k8MZezXo tY+g== MIME-Version: 1.0 X-Received: by 10.50.26.66 with SMTP id j2mr34011980igg.45.1412699767347; Tue, 07 Oct 2014 09:36:07 -0700 (PDT) Received: by 10.64.76.136 with HTTP; Tue, 7 Oct 2014 09:36:07 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Oct 2014 17:36:07 +0100 Message-ID: To: Matthew Fonda Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7bd75bb2cea4400504d7cb71 Subject: Re: [PHP-DEV] ArrayPath From: mathiasgrimm@gmail.com (Mathias Grimm) --047d7bd75bb2cea4400504d7cb71 Content-Type: text/plain; charset=UTF-8 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 > --047d7bd75bb2cea4400504d7cb71--