Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61093 invoked from network); 12 Feb 2016 14:29:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2016 14:29:12 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:33516] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/E3-25203-73CEDB65 for ; Fri, 12 Feb 2016 09:29:11 -0500 Received: by mail-wm0-f41.google.com with SMTP id g62so64767637wme.0 for ; Fri, 12 Feb 2016 06:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=L3T9aLUa/e9rDRLozCpEz+7DRFn9WqOOWrXNnHeAXXo=; b=vr+iAH8jPLE4ICgdNqD/I6hAT8xVjarpW2eEzE9LAJ3epxUlikYNg+go3Vycbgs4gE npSoOs5SCMBxwdwOYCZ8GONZYDdZj+84c0woDNudgbWiBe5kJ8E0mvUARvQBubIL7CTu xD0XxZ8TmEVwCVu+tvULHU1Y44vHiSDAFUEoRC+uVCwIorswlvTUrXVuYrER6XKS91XG FHs10s0TI/tLxNRRBycRM+R+dNeUxpPUcdFDdFCNP51TiSZwk6ph97OV0Fgsaoo5zdsb BovBaVQY7uaWgVunmEKlvxuWcANzwotrQ0w51K2IkByBgYGWPvbMjhbZCJV89ToevqzF XL1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=L3T9aLUa/e9rDRLozCpEz+7DRFn9WqOOWrXNnHeAXXo=; b=lw8bPiJOMf53kzXH3qYl6Gm9XbZj9dkafgs4oH8iURrTI03X9HC6FGn01EQNXrB17t FUJ/vtugYNnEpgxs3KKp73oQ/HxenZqr7VVjr7A4CrKstcVAqDAoHYGdifo1/qw4ZlGG hN/XjSZSPc+Fcql5VlZa0d8te6CIJRbJW1NEVSTJEa2eNLJQ7mIokTdqVAcEpaIenPZJ ZVWbkZhQ0vRNG2m7a/IlrFKmFKYeQ7437L+aWqi85hv1rVMuafVLCXvllZCC/gdXHWxV FBGGnAeFM7yv75fZbg7ez5LIupQ+jzB+PLQe0mu/tlsBlN2xpaS7jdMTuKGXgzddUq6D nrEg== X-Gm-Message-State: AG10YORWwXMsZC1Vhc6k6w1AgEMb5Id9c4IWNTiAWRzj8GeNN71hMUhCx5KJPVNdgw2syg== X-Received: by 10.28.73.136 with SMTP id w130mr5035460wma.36.1455287347653; Fri, 12 Feb 2016 06:29:07 -0800 (PST) Received: from [192.168.0.152] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id w17sm2642766wmw.5.2016.02.12.06.29.06 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 06:29:06 -0800 (PST) To: internals@lists.php.net References: <38.31.07203.2EB94B65@pb1.pair.com> <8E.1A.36326.338F8B65@pb1.pair.com> Message-ID: <56BDEBC8.4090806@gmail.com> Date: Fri, 12 Feb 2016 14:27:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][VOTE] Allow specifying keys in list() From: rowan.collins@gmail.com (Rowan Collins) S.A.N wrote on 12/02/2016 13:37: > Often all keys are unknown, or a very lot keys, use list(...) - is unreal. > > I would like to, instead > foreach($params as $key => $value) > { > $this{$key} = $value > } > > Use the short syntax sugar > $this += $params > > ?> > > It's really do? > If the keys are unknown, then you probably don't want to blindly copy them onto object properties; at that point, you might as well just have $this->data and leave them as an array. It sounds like what you actually want is an object literal syntax - i.e. $params should never have been an array in the first place.