Re: [RFC][Discussion] - list() reference syntax

From: Date: Wed, 11 Jan 2017 22:14:53 +0000
Subject: Re: [RFC][Discussion] - list() reference syntax
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-97704@lists.php.net to get a copy of this message
Hi Dave, Regarding the =& open issue in the RFC, I don't think the =& syntax makes sense to me. The thing on the right-hand side of a list() assignment is the array, not its values. It makes no difference for the purposes of assigning from its values if the array is a reference or not, so I'd expect the & here to do nothing at all. So, having the &s only on the left-hand side makes more sense to me. I think supporting =& would be a potential source of confusion. On a different note, the RFC doesn't mention support for the shorthand list() syntax introduced in 7.1 (i.e. [&$a, &$b, &$c] = $arr;). Since it shares its implementation with list(), I assume it is indeed supported, but you should probably explicitly whether or not it is, for clarity's sake. Thanks for your work on this! I'm glad to see it revived. :) -- Andrea Faulds https://ajf.me/

« previous php.internals (#97704) next »