Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93374 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4168 invoked from network); 17 May 2016 13:10:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2016 13:10:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.47 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.47 mail-wm0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:37180] helo=mail-wm0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/B2-19201-F281B375 for ; Tue, 17 May 2016 09:10:10 -0400 Received: by mail-wm0-f47.google.com with SMTP id a17so30194949wme.0 for ; Tue, 17 May 2016 06:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=xV0voErtlkksR2wDG1krkx5rH/3L4K1fscZmNaKFyYc=; b=b947GJIFL3kqzoPNBxjggAbWAGhVTijEccjltD8uIiMs8SbfB7c4iz8+FmH2tpxF+D eZ1ffBU23w9xPFBzHBDTWIrwo767JO/qn7+4+16Ovw505KriZqYvknZ7R08kgX975tg1 HVxvv1cR6eoB8KAR+2kTDdzYd+RfpGfcOEGPLtkVroA86OhJZDix0qB3UFnOEDMntetQ 45evcdV05R5Ils91zgcPXeT/fCtQk3SAI9IIOY4aJLGG+h/2jXMZfv/XW4z8A/ktJifa OMj4b1jW9p47dVMBDyLmslm9xbwEs+ARppSdf91Q+OMAyY9nL3aWkJ0zBIh52tbNlbWY 8jrg== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xV0voErtlkksR2wDG1krkx5rH/3L4K1fscZmNaKFyYc=; b=LfRbRmIan7oG/sY2osQKqyzefnMbVzXLDRRTsXNWhVQrJcCumD1xhVAveBKlLBfcqX 3AYeharGjmqh48aSlY5zUmY58qJ6x4f4VZF3Ct41sEdnKkQ2S1TpuSypF/H+epGXj/sb mPZMdG5il7OFsih0HaULar9Zbf0B5CNFYkal2+A9B9+7IsocKo9ZyBZxrWR8ivDxiHfw /PQbwCvC5pptN7Fo8G9BliqaRxF4VaN6kwF+RgivXqSD10t9FkQazX/JrrMdd+EyOpkG tsybIMPa65sZypLoOfObUFD+kV+JOXQi8CVyapLFnaulrrSGwfQtQqyYH6Pf+eGVX7Sb eMYQ== X-Gm-Message-State: AOPr4FXACXxE7cEHE8GMPMgmzG2c36flXpxtfLnuotMrzbB3TCwzifiQNYvj8wgop5gTBQ== X-Received: by 10.194.121.8 with SMTP id lg8mr1498851wjb.16.1463490605066; Tue, 17 May 2016 06:10:05 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id xt9sm3066856wjb.17.2016.05.17.06.10.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 06:10:04 -0700 (PDT) To: Jesse Schalken References: <66d7fe0f-6c0b-c6c0-f30a-a54ccd10e949@gmail.com> Cc: PHP internals Message-ID: Date: Tue, 17 May 2016 14:08:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 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] Pipe Operator From: rowan.collins@gmail.com (Rowan Collins) On 17/05/2016 13:48, Jesse Schalken wrote: > > On Tue, May 17, 2016 at 9:14 PM, Rowan Collins > wrote: > > To reiterate my comments from earlier in the thread, I think the > "$id = $id" looks really weird here, and spoils the step-by-step > layout - and, in this case, the symmetry. > > > We have the same thing already when chaining methods on value/immutable > objects, like with PSR-7: > > $message = $message > ->withHeader('foo', 'bar') > ->withAddedHeader('foo', 'baz'); > > > So depending on often that pattern is used, many are probably already > used to seeing "$var = $var ....", myself included. A fair point. Although you could of course combine OO chaining with syntax chaining: $message ->withHeader('foo', 'bar') ->withAddedHeader('foo', 'baz') |=> $message; The longer the chain, the more awkward it is to rewind to the beginning to find where the result is being used / saved. See also my earlier post where I went into why a tail assignment would improve the ability to debug pipes, and mix them with non-piped code: http://marc.info/?l=php-internals&m=146205812523026&w=2 Again, all of this applies to mixing with existing OO pipes like PSR-7. Regards, -- Rowan Collins [IMSoP]