Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74236 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26739 invoked from network); 15 May 2014 19:12:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2014 19:12:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:52995] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/42-14382-0B115735 for ; Thu, 15 May 2014 15:12:49 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 090692000B7 for ; Thu, 15 May 2014 15:12:46 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.registrar-servers.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id akQZptoBcNot for ; Thu, 15 May 2014 15:12:45 -0400 (EDT) Received: from [192.168.0.200] (unknown [90.203.28.11]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id DF6452000A5 for ; Thu, 15 May 2014 15:12:44 -0400 (EDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_02B60CD2-5573-485D-AA8E-692797343BE5" Message-ID: Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Date: Thu, 15 May 2014 20:12:41 +0100 References: <52699BBD.5030407@ajf.me> To: PHP internals In-Reply-To: <52699BBD.5030407@ajf.me> X-Mailer: Apple Mail (2.1874) Subject: Re: [PHP-DEV] [RFC] list() Reference Assignment From: ajf@ajf.me (Andrea Faulds) --Apple-Mail=_02B60CD2-5573-485D-AA8E-692797343BE5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Good evening, So, I came back to this today. It appears to me that it=92s actually = impossible for me to implement this feature properly at the present = moment, due to the parser directly emitting opcodes. This is a shame. = Unfortunately, there=92s really nothing I can do about it. Hence, I hereby withdraw my RFC. Thanks. On 24 Oct 2013, at 23:14, Andrea Faulds wrote: > Good evening again, >=20 > Previously I wrote to this mailing list about my proposal to add = reference assignment to list() with a new syntax ("[PHP-DEV] Proposal: = Implement FR #7930 (list() constructor reference assignment)"). I have = now opened an RFC: >=20 > https://wiki.php.net/rfc/list_reference_assignment >=20 > In brief, this allows you to write this: >=20 > $array =3D [1, 2]; > $a =3D $array[0]; > $b =3D &$array[1]; >=20 > Like this instead: >=20 > $array =3D [1, 2]; > list($a, &$b) =3D $array; >=20 > Reference assignments with list() work just like normal assignments, = and you can still skip variables, use nested list()s, and use list() in = foreach as usual. >=20 > There is a patch with a passing test, however a memory leak bug was = found (thanks Nikita!), and so the patch can't be considered complete or = final yet. I'm something of a novice at debugging PHP code at the = moment, so any help fixing that would be appreciated, but I will try to = fix it when I have more time. >=20 > The patch is here: https://bugs.php.net/bug.php?id=3D6768 >=20 > The RFC has been added to the list in Under Discussion. >=20 > Any thoughts, suggestions, etc. appreciated. >=20 > Regards, > --=20 > Andrea Faulds > http://ajf.me/ >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 -- Andrea Faulds http://ajf.me/ --Apple-Mail=_02B60CD2-5573-485D-AA8E-692797343BE5--