Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77812 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98620 invoked from network); 7 Oct 2014 17:30:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2014 17:30:23 -0000 Authentication-Results: pb1.pair.com header.from=ingwie2000@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ingwie2000@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: ingwie2000@googlemail.com X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:44863] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/2E-30869-D2324345 for ; Tue, 07 Oct 2014 13:30:22 -0400 Received: by mail-wg0-f46.google.com with SMTP id l18so9932919wgh.29 for ; Tue, 07 Oct 2014 10:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SJY0uf3Jbl63X+BMJnSGee92HrlkEaoArFKuab1M2I4=; b=ZseBIYcA/LnpADjq2XpAizwrHIf0RojaIal+pEu+GLtIaLOq88uHFKdJcg6NHQr55T bzsN+q8EIQxb0ER9vhtjCSfKASok9oWQxppzrYvziJXl7/tY3pLTg8I6TpJhfWcSEGk4 iXgpu4woQUWABSyikGmJGr12fQfUhUMFXGP9oR/7uEJjJXSTmVZ8i6QNpZC92pxU34Yh rFN+EyvtcaTbfngdYwcWAiK+m/QfxjfSVrAQeHNs/WR51qIQ1G3SweoR88mt1cL0SLu5 rAs8aPU3rV5KfDgky7PUy1lFmXDBUQrEBUnPycYNtu7LZ5WdLeNSh5kSJmkVdxOjvdme cPEw== X-Received: by 10.194.133.135 with SMTP id pc7mr6478769wjb.54.1412703019051; Tue, 07 Oct 2014 10:30:19 -0700 (PDT) Received: from [192.168.200.103] (dslb-088-069-033-057.088.069.pools.vodafone-ip.de. [88.69.33.57]) by mx.google.com with ESMTPSA id cz3sm21539629wjb.23.2014.10.07.10.30.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 10:30:18 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Tue, 7 Oct 2014 19:30:11 +0200 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <20DD1EC9-638E-46AF-8022-97826C1F0B35@googlemail.com> References: To: Mathias Grimm X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] ArrayPath From: ingwie2000@googlemail.com (Ingwie Phoenix) Am 07.10.2014 um 18:05 schrieb Mathias Grimm : > Hi, > I would like to suggest something for php like a class I am using >=20 > https://github.com/mathiasgrimm/arraypath >=20 > The reason is to access arrays like this: >=20 > $idx3 =3D ArrayPath::get('idx1/idx2/idx3', $_POST, 'myDefaultValue'); >=20 >=20 > Regards, > Mathias Oh my god. This is seriously one enhancement that I haven=92t seen = before. If a function like this makes it into PHP, we can speak of one = very unique enhanement here. I like the example of a later email, as in $_POST::get(=85) Extending the capabilities of arrays and giving them something like = above, would be nice. But I can see where the syntax would clash: $_POST = would be expected to be an object with a __toString() method, :: = refferences to a static method=85=20 But maybe, some smart head can figure something out. It would, at least, = be an interesting functionality. By the way, I would suggest swapping the path and array argument. As in, = =84Get from $array the path =82=85=91=93. Just a suggestion.=