Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53141 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93979 invoked from network); 7 Jun 2011 13:53:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2011 13:53:30 -0000 Authentication-Results: pb1.pair.com header.from=johncrenshaw@priacta.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=johncrenshaw@priacta.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain priacta.com designates 64.95.72.238 as permitted sender) X-PHP-List-Original-Sender: johncrenshaw@priacta.com X-Host-Fingerprint: 64.95.72.238 mx1.myoutlookonline.com Received: from [64.95.72.238] ([64.95.72.238:41993] helo=mx1.myoutlookonline.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/3C-30784-95D2EED4 for ; Tue, 07 Jun 2011 09:53:29 -0400 Received: from st20.mx1.myoutlookonline.com (localhost [127.0.0.1]) by mx1.myoutlookonline.com (Postfix) with ESMTP id 9BFEE8BEC49; Tue, 7 Jun 2011 09:53:26 -0400 (EDT) X-Virus-Scanned: by SpamTitan at mail.lan Received: from HUB028.mail.lan (unknown [10.110.2.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.myoutlookonline.com (Postfix) with ESMTPS id 266808BEAB2; Tue, 7 Jun 2011 09:53:26 -0400 (EDT) Received: from MAILR001.mail.lan ([192.168.1.2]) by HUB028.mail.lan ([10.110.17.28]) with mapi; Tue, 7 Jun 2011 09:52:28 -0400 To: Hannes Landeholm , "internals@lists.php.net" Date: Tue, 7 Jun 2011 09:53:18 -0400 Thread-Topic: [PHP-DEV] Inline constructing/cloning and inline foreach listing Thread-Index: AcwlFvi5tviPvY5PRCOYQmyaDitVuQAAlt8A Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] Inline constructing/cloning and inline foreach listing From: johncrenshaw@priacta.com (John Crenshaw) > // Inline constructing: > $car =3D (new CarFactory())->makeCar(); > // Inline cloning: > $tomorrow =3D (clone $today)->add($one_day); Agreed. The fact that these expressions can't be wrapped in parentheses nev= er made any sense to me. > foreach ($arrays as list($e1, $e2, $e3)) { ... Disagree. This feels very obtuse. I wouldn't expect this construct to work = at all, and even if it did, it is highly ambiguous (I.E. at first I thought= you were intending to grab 3 entries at a time, rather than extracting ent= ries from a second array). John Crenshaw Priacta, Inc.