Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77825 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44233 invoked from network); 8 Oct 2014 01:21:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Oct 2014 01:21:55 -0000 Authentication-Results: pb1.pair.com header.from=mtdowling@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mtdowling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.53 as permitted sender) X-PHP-List-Original-Sender: mtdowling@gmail.com X-Host-Fingerprint: 209.85.220.53 mail-pa0-f53.google.com Received: from [209.85.220.53] ([209.85.220.53:44484] helo=mail-pa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/F1-34162-1B194345 for ; Tue, 07 Oct 2014 21:21:53 -0400 Received: by mail-pa0-f53.google.com with SMTP id kq14so8149242pab.12 for ; Tue, 07 Oct 2014 18:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=MJEz2i+yl5l86fmlVmHVVhklu2t+xfML9sZfmuC+6rw=; b=NAUEHclBqULMg3oA1mCOHndYr8WSCBhsuJ6OgISQ/AMsnZAkWCo0y5DW+Sm3nIvEHV aGesltyDV8WQ7+MXAHpQlZ/bzJq+3UWP6CKudNyo56yJ2kYV0ELbZQ85c8p7flv0Fbee D8q49gzAj+RqUOQeeoK1lkwGSufLEYcCAzZG6g+4sIl+yGWypfsgs6bd6gJNgyDW5pLP 3B67cXyydkHLh5xpm8tMdfe6w1T3jcs4P6wAqLMwjKvB3TRFyqz1BOjKp/qkXkqpSNVk gADNxx8OvvgdGqVGIg1jxtDxWLljMpX/QunQxueUiOLOHD4GPv3HhK2Fy1OPdDhiK74K /+qQ== X-Received: by 10.70.103.100 with SMTP id fv4mr7095547pdb.38.1412731309797; Tue, 07 Oct 2014 18:21:49 -0700 (PDT) Received: from [10.19.113.189] (mobile-166-137-213-064.mycingular.net. [166.137.213.64]) by mx.google.com with ESMTPSA id w1sm14891216pdb.52.2014.10.07.18.21.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 18:21:48 -0700 (PDT) References: <1412702156.4712.215.camel@kuechenschabe> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <3943CEE1-C1DE-4B01-AD92-94C4BB2F2012@gmail.com> Cc: =?utf-8?Q?Johannes_Schl=C3=BCter?= , Mathias Grimm , "internals@lists.php.net" X-Mailer: iPhone Mail (11B651) Date: Tue, 7 Oct 2014 18:21:48 -0700 To: Mike Willbanks Subject: Re: [PHP-DEV] ArrayPath From: mtdowling@gmail.com (Michael Dowling) > This request seems to be more in the realm of having XPath type support fo= r > 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 necessaril= y > believe it belongs in the core. This seems much better for a PECL module > if necessary. >=20 > 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. I agree that this definitely does not belong in core. This has been tried with json via json-path, but there's no formal grammar o= r compliance test suite to back it. It's basically a really old blog post th= at has never been formalized. There's a much more robust alternative called j= mespath that works across multiple languages and has a PHP implementation: h= ttps://github.com/mtdowling/jmespath.php I think this shows that this is a problem that can and has already been solv= ed in user land (multiple times in multiple ways), and it can be done in a p= erformant way (e.g., compiling expressions into PHP code). I don't see a nee= d to add bloat to PHP's core for this. -Michael