Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77817 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7260 invoked from network); 7 Oct 2014 18:18:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2014 18:18:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=pencap@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pencap@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.178 as permitted sender) X-PHP-List-Original-Sender: pencap@gmail.com X-Host-Fingerprint: 209.85.223.178 mail-ie0-f178.google.com Received: from [209.85.223.178] ([209.85.223.178:46320] helo=mail-ie0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/DF-30869-66E24345 for ; Tue, 07 Oct 2014 14:18:15 -0400 Received: by mail-ie0-f178.google.com with SMTP id rl12so5902665iec.37 for ; Tue, 07 Oct 2014 11:18:10 -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=pLcGA5gcWYbf7yZtdlGrc1o2Rd2CKvvgUaWPpDoMDSE=; b=gtYOUeMBn9dKX7LgpCAfOEAOhx0JKSvudl4ilpy3+fXF2yiUTxQ0ZOqXGGfRCMQ39i MVRh3NSeD5sik0TOs09SQYeVk8P+lVSlIF7fpquS8q+DaGStPjmgAlOTEEfOJGVkjkuW aAI+bmkbHX0H5H+gdWsPfUc0WZjx507EX3orNqF/iI5NfzbtlYaEQVekfIOUbIwenkAB eEtrQ+jIckDjQbBY2urwslILebRaNFZtsWGi2EKPFAj5VdbnlnBSzMeV/n3xJ4p691XY A1SMSr9Pyg7wr0RY9j7jpqBDgblHfJY9DL5Xu1PX7SVbOBy/cjAa3yd9+WvDEYLSGwaT ivPQ== MIME-Version: 1.0 X-Received: by 10.42.188.14 with SMTP id cy14mr6945931icb.52.1412705890437; Tue, 07 Oct 2014 11:18:10 -0700 (PDT) Received: by 10.50.85.230 with HTTP; Tue, 7 Oct 2014 11:18:10 -0700 (PDT) In-Reply-To: <1412702156.4712.215.camel@kuechenschabe> References: <1412702156.4712.215.camel@kuechenschabe> Date: Tue, 7 Oct 2014 13:18:10 -0500 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Mathias Grimm , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf301fb8f9c590eb0504d938f5 Subject: Re: [PHP-DEV] ArrayPath From: pencap@gmail.com (Mike Willbanks) --20cf301fb8f9c590eb0504d938f5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Oct 7, 2014 at 12:15 PM, Johannes Schl=C3=BCter wrote: > On Tue, 2014-10-07 at 17:05 +0100, 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 =3D ArrayPath::get('idx1/idx2/idx3', $_POST, 'myDefaultValue'); > > what hppens if my array has a / as part of the key? Do I have to check > that beforehand and set a custom identifier? So what happens if I use > your example with $_GET instead of $_POST and a user requests > foo.php?idx1=3Didx2/idx3 > > I'm not really convinced. > This request seems to be more in the realm of having XPath type support for arrays, likewise people have also attempted to do this with JSON. It does seem like it could be valuable to some degree, however, I don't necessarily believe it belongs in the core. This seems much better for a PECL module if necessary. If the key has a / it would seem like you should escape it like a regular string escape, aka "\/". I'm not convinced this is something that is necessary in PHP either. There does not seem to be a great use case for this use. > > johannes > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --20cf301fb8f9c590eb0504d938f5--