Re: [VOTE] Fix list() behavior inconsistency

From: Date: Thu, 25 Sep 2014 22:08:32 +0000
Subject: Re: [VOTE] Fix list() behavior inconsistency
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-77637@lists.php.net to get a copy of this message
On 25 September 2014 22:50, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > Hi! > >> It was on design. list() was intended to support plain arrays only. > > I'm not sure I'm getting this point - why list($a, $b) = $foo is not > just translated as $a = $foo[0], $b = $foo[1], etc.? Is it hard to make > it work that way? > Why do array_* functions not treat strings as arrays of bytes? If we we can/want to make strings byte arrays, then I am 100% in favour of all array operations working on strings. If this is something we want to work towards for the future, that's great, lets get busy :) - If we want to say "yea list() should work with strings", but no other array functions should work with strings, it seems very odd to me.

« previous php.internals (#77637) next »