Re: [RFC] Fix list() behavior inconsistency
| From: | Lester Caine | Date: | Sun, 14 Sep 2014 07:54:25 +0000 |
| Subject: | Re: [RFC] Fix list() behavior inconsistency | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77173@lists.php.net to get a copy of this message | ||
On 14/09/14 07:48, Stas Malyshev wrote:
>> Please take a look and make your opinion.
>> >
>> >
>> > https://wiki.php.net/rfc/fix_list_behavior_inconsistency
>> >
>> > This inconsistency might be interpreted like a bug, but fixing it might
>> > break existing PHP code (at least my attempt to fix it in documented way
>> > broke few phpt tests).
> I think it makes sense to make list($a, $b, ...) = <something> to mean:
> $a = <something>[0]
> $b = <something>[1]
> ...etc...
>
> This is how it works in most cases, not sure why it doesn't work when
> <something> is a string literal, but I think it should work the same too.
Isn't this just a side affect of making a simple string also look like
an array? One has to assume first that what is returned is a simple byte
string array while currently is IS possible that it will contain unicode
characters? So should it not be looked at n the context of the whole
PHP7 discussion rather than trying to fix more edge cases in isolation?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk