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 <mfo...@php.net> wrote:

> On Tue, Oct 7, 2014 at 9:05 AM, Mathias Grimm <mathiasgr...@gmail.com>
> 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
>

Reply via email to