Re: [PHP-DEV] Re: list() limitations

2002-04-06 Thread Stig S. Bakken
On Sat, 2002-04-06 at 11:45, Philip Olson wrote: > > > Aside from saying it works on values for numerical arrays > > > I can't say much else. That is intuitive and consistant > > > to me, not ambiguous. > > > > It is :) Since we both already have different views. I > > suggest leavin

Re: [PHP-DEV] Re: list() limitations

2002-04-06 Thread Markus Fischer
On Sat, Apr 06, 2002 at 09:45:08AM +, Philip Olson wrote : > > > Aside from saying it works on values for numerical arrays > > > I can't say much else. That is intuitive and consistant > > > to me, not ambiguous. > > > > It is :) Since we both already have different views. I > >

Re: [PHP-DEV] Re: list() limitations

2002-04-06 Thread Philip Olson
> > Aside from saying it works on values for numerical arrays > > I can't say much else. That is intuitive and consistant > > to me, not ambiguous. > > It is :) Since we both already have different views. I > suggest leaving it; it's not worth the trouble and using the > array_(k

Re: [PHP-DEV] Re: list() limitations

2002-04-06 Thread Markus Fischer
On Sat, Apr 06, 2002 at 09:35:25AM +, Philip Olson wrote : > > The big question is: how would You (Philip,Yasuo) want list > > to behave when it encounters a hash? Do you want to get the > > keys ? Or the values? Or do you want to get the hashed > > element on its own again as

Re: [PHP-DEV] Re: list() limitations

2002-04-06 Thread Philip Olson
> The big question is: how would You (Philip,Yasuo) want list > to behave when it encounters a hash? Do you want to get the > keys ? Or the values? Or do you want to get the hashed > element on its own again as key => value ? My opinion is: $foo = array('a' => 'apple', 'b' => 'b

Re: [PHP-DEV] Re: list() limitations

2002-04-06 Thread Markus Fischer
The big question is: how would You (Philip,Yasuo) want list to behave when it encounters a hash? Do you want to get the keys ? Or the values? Or do you want to get the hashed element on its own again as key => value ? No, I don't think it's a good idea. That is why we have

Re: [PHP-DEV] Re: list() limitations

2002-04-05 Thread Yasuo Ohgaki
Philip Olson wrote: >>> $foo = array('a' => 'apple', 'b' => 'banana'); >>> >>> // Notice - Undefined offset: 1 >>> // Notice - Undefined offset: 0 >>> list($a,$b) = $foo; >> >>Isn't this line should be >> >>list($a, $b) = array_keys($foo); >>or >>list($a, $b) = array_values($foo); > > >

Re: [PHP-DEV] Re: list() limitations

2002-04-05 Thread Philip Olson
> > $foo = array('a' => 'apple', 'b' => 'banana'); > > > > // Notice - Undefined offset: 1 > > // Notice - Undefined offset: 0 > > list($a,$b) = $foo; > > Isn't this line should be > > list($a, $b) = array_keys($foo); > or > list($a, $b) = array_values($foo); Sure that works. > I

[PHP-DEV] Re: list() limitations

2002-04-05 Thread Yasuo Ohgaki
Philip Olson wrote: > Hello, the following behavior seems odd: > > $foo = array('a' => 'apple', 'b' => 'banana'); > > // Notice - Undefined offset: 1 > // Notice - Undefined offset: 0 > list($a,$b) = $foo; Isn't this line should be list($a, $b) = array_keys($foo); or list($a, $b)