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

From: Date: Mon, 18 Jan 2016 12:35:40 +0000
Subject: Re: [RFC] Allow specifying keys in list()
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-90695@lists.php.net to get a copy of this message
On 18/01/16 07:19, Michael Wallner wrote: >> Here's an RFC that would extend the syntax of list() to be more useful >> > with associative arrays: >> > >> > https://wiki.php.net/rfc/list_keys >> > >> > Please read it and tell me your thoughts. > Hi! > > I found the idea convincing from the first read, but maybe it's just my > mind's assumptions about list() that I dislike the resulting syntax, > yet, it seems to be the logical choice. > > So, maybe I'm just trying to say, that I don't like list() to be reused > for that, but I don't have any better idea otherwise. As someone still using 'extract' in legacy code, I can sort of see the logistics of this, but why not just extend 'extract' to use the current object rather than the symbol table. It already has handling for duplicate keys and to prefix the 'array' name to the resulting variables. -- 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

« previous php.internals (#90695) next »