Re: [RFC][VOTE] Allow specifying keys in list()

From: Date: Sat, 06 Feb 2016 05:25:59 +0000
Subject: Re: [RFC][VOTE] Allow specifying keys in list()
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-91096@lists.php.net to get a copy of this message
Hi, 2016-02-05 23:58 GMT-04:00 Levi Morrison <levim@php.net>: > On Fri, Feb 5, 2016 at 5:55 AM, Andrea Faulds <ajf@ajf.me> wrote: >> Hi everyone, >> >> It's been more than two weeks since I first proposed this RFC, and there's >> no outstanding issues preventing moving towards a vote. There's not yet a >> language specification patch, but that can be done later. >> >> So, I'm opening the vote on this RFC today, 2016-02-05, and it'll close the >> Sunday after next, 2016-02-14. The vote requires a 2/3 majority as it's a >> language change. >> >> The RFC page is here: https://wiki.php.net/rfc/list_keys >> >> Happy voting! >> -- >> Andrea Faulds >> https://ajf.me/ >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php > > I wanted to chime in since I voted no. I'm not strongly opposed to > this behavior but I do have concerns about the key behavior that was > changed. In an example in the RFC: > > list($foo => $bar) = $array; > > I don't think this really makes sense. $foo is being > evaluated and > its value is used to look up the key in $array, but > $bar is being > assigned to even though it's a similar place as $foo. > > I don't think I've really expressed well what I am trying to convey > but I think this RFC would be much better *without* this change, so > I've voted no. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > "yes" voter here... I'm not 100% sure if I understand your concern perfectly. Evaluating the key as an expression seems to make sense, specially on examples like: ``` list( CURLOPT_GET => $isGet, CURLOPT_POST => $isPost, CURLOPT_URL => $url ) = $curlOptions; ``` Would you mind to elaborate more why do you think this is a problem? :) Thank you, Márcio.

« previous php.internals (#91096) next »