Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97880 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52509 invoked from network); 19 Jan 2017 18:12:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2017 18:12:39 -0000 Authentication-Results: pb1.pair.com header.from=flaupretre@free.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=flaupretre@free.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain free.fr from 212.27.42.4 cause and error) X-PHP-List-Original-Sender: flaupretre@free.fr X-Host-Fingerprint: 212.27.42.4 smtp4-g21.free.fr Received: from [212.27.42.4] ([212.27.42.4:60118] helo=smtp4-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/3B-00729-69101885 for ; Thu, 19 Jan 2017 13:12:39 -0500 Received: from [172.16.0.75] (unknown [158.255.108.131]) (Authenticated sender: flaupretre) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 82A9919F5A8; Thu, 19 Jan 2017 19:12:30 +0100 (CET) To: Levi Morrison , Sara Golemon References: Cc: PHP internals Message-ID: Date: Thu, 19 Jan 2017 19:12:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Pipe Operator v2 From: flaupretre@free.fr (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Le 19/01/2017 à 13:54, Levi Morrison a écrit : > The `|>` symbol would be the piping operator with these semantics: > 1. Evaluate the left-hand side. > 2. Evaluate the right-hand side. Assert that the result is callable. > 3. Pass the result from 1. as the single argument to 2. May I suggest extending your 3rd rule to : when the right hand side has the form of a function call, insert the result from 1. as first argument of 2. This way, right hand side may specify additional arguments. Based on the fact that, in 99% of PHP builtin functions where the concept applies, the 'input' argument is the first one. Example : $string |> trim('.,;:') $string |> trim() IMO, not acceptable : $string |> trim Regards François