Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-23 Thread S.A.N
What would happen if some key from `$xpath` is undefined on the > multidimensional `$array`? > Notice: Undefined index... Return NULL.

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-23 Thread Marcio Almada
> I always wanted to have an analog XPath to access the array elements. > Something like: > $array = ['x' => ['p' => ['a' => ['t' => ['h' => 'value']; > $xpath = ['x', 'p', 'a', 't', 'h']; > $value = $array[...$xpath]; > var_dump($value); // string(5) "value" > ?> What would happen if some k

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-23 Thread S.A.N
> > > That would be quite confusing, we don’t allow $array[‘x’, ‘p’, ‘a’, ’t’, > ‘h’] just now. > Andrea Faulds > Yes, I know, but it would be convenient, maybe someone will offer the best option syntax.

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-23 Thread Andrea Faulds
> On 23 Nov 2014, at 23:07, S.A.N wrote: > > I always wanted to have an analog XPath to access the array elements. > Something like: > > > $array = ['x' => ['p' => ['a' => ['t' => ['h' => 'value']; > $xpath = ['x', 'p', 'a', 't', 'h']; > $value = $array[...$xpath]; > > var_dump($value);

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-23 Thread S.A.N
I always wanted to have an analog XPath to access the array elements. Something like: ['p' => ['a' => ['t' => ['h' => 'value']; $xpath = ['x', 'p', 'a', 't', 'h']; $value = $array[...$xpath]; var_dump($value); // string(5) "value" ?> This is certainly a topic for another RFC, but this func

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-07 Thread Rowan Collins
On 05/11/2014 11:43, Chris Wright wrote: On 5 November 2014 11:22, Leigh > wrote: On 4 November 2014 18:14, Rowan Collins mailto:rowan.coll...@gmail.com>> wrote: > > If anything, I think I would expect the keys of splatted arrays to be discarded, since it

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-07 Thread Rowan Collins
On 05/11/2014 10:24, Chris Wright wrote: On 4 November 2014 18:14, Rowan Collins > wrote: On 3 November 2014 22:45:11 GMT, Chris Wright mailto:daveran...@php.net>> wrote: >Good evening list, > >I'd like to open discussion a relatively simple and

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-07 Thread Rowan Collins
On 04/11/2014 20:55, Andrea Faulds wrote: If anything, I think I would expect the keys of splatted arrays to be discarded, since it seems most natural to use this in a list context, but I can imagine always having to check in the manual. I don’t think they’d be discarded. The named parameters

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-05 Thread Chris Wright
On 5 November 2014 11:43, Chris Wright wrote: > On 5 November 2014 11:22, Leigh wrote: > >> On 4 November 2014 18:14, Rowan Collins wrote: >> > >> > If anything, I think I would expect the keys of splatted arrays to be >> discarded, since it seems most natural to use this in a list context, but

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-05 Thread Chris Wright
On 5 November 2014 11:22, Leigh wrote: > On 4 November 2014 18:14, Rowan Collins wrote: > > > > If anything, I think I would expect the keys of splatted arrays to be > discarded, since it seems most natural to use this in a list context, but I > can imagine always having to check in the manual.

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-05 Thread Leigh
On 4 November 2014 18:14, Rowan Collins wrote: > > If anything, I think I would expect the keys of splatted arrays to be > discarded, since it seems most natural to use this in a list context, but I > can imagine always having to check in the manual. I agree on this point. Duplicate keys should

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-05 Thread Chris Wright
Hi Dmitry On 4 November 2014 20:13, Dmitry Stogov wrote: > I like the idea, especially list($a, $b, ...$c) = ... > Looks like Prolog's [A, B | C] = ..., unfortunately it won't provide the > same semantic and performance. > Implementation needs to be reviewed, but I think it must not affect > exi

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-05 Thread Chris Wright
On 4 November 2014 18:14, Rowan Collins wrote: > On 3 November 2014 22:45:11 GMT, Chris Wright wrote: > >Good evening list, > > > >I'd like to open discussion a relatively simple and clear-cut RFC, > >either > >people will like it or they won't, there isn't a lot more to say here > >than > >what

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-04 Thread Andrea Faulds
> On 4 Nov 2014, at 18:14, Rowan Collins wrote: > > On 3 November 2014 22:45:11 GMT, Chris Wright wrote: >> Good evening list, >> >> I'd like to open discussion a relatively simple and clear-cut RFC, >> either >> people will like it or they won't, there isn't a lot more to say here >> than >>

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-04 Thread Dmitry Stogov
I like the idea, especially list($a, $b, ...$c) = ... Looks like Prolog's [A, B | C] = ..., unfortunately it won't provide the same semantic and performance. Implementation needs to be reviewed, but I think it must not affect existing opcodes. Thanks. Dmitry. On Tue, Nov 4, 2014 at 1:45 AM, Chris

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-04 Thread Rowan Collins
On 3 November 2014 22:45:11 GMT, Chris Wright wrote: >Good evening list, > >I'd like to open discussion a relatively simple and clear-cut RFC, >either >people will like it or they won't, there isn't a lot more to say here >than >what's in the RFC so please have a read. > >https://wiki.php.net/rfc/

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-03 Thread Andrea Faulds
> On 3 Nov 2014, at 22:45, Chris Wright wrote: > > I'd like to open discussion a relatively simple and clear-cut RFC, either > people will like it or they won't, there isn't a lot more to say here than > what's in the RFC so please have a read. > > https://wiki.php.net/rfc/additional-splat-usag

Re: [PHP-DEV] [RFC] Additional splat operator usage

2014-11-03 Thread Leigh
On 3 November 2014 22:45, Chris Wright wrote: > Good evening list, > > I'd like to open discussion a relatively simple and clear-cut RFC, either > people will like it or they won't, there isn't a lot more to say here than > what's in the RFC so please have a read. > > https://wiki.php.net/rfc/addi

[PHP-DEV] [RFC] Additional splat operator usage

2014-11-03 Thread Chris Wright
Good evening list, I'd like to open discussion a relatively simple and clear-cut RFC, either people will like it or they won't, there isn't a lot more to say here than what's in the RFC so please have a read. https://wiki.php.net/rfc/additional-splat-usage Thanks, Chris