Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93317 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2909 invoked from network); 13 May 2016 17:18:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2016 17:18:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:8238] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/05-01216-E5C06375 for ; Fri, 13 May 2016 13:18:24 -0400 Received: from [127.0.0.1] (unknown [82.240.16.115]) (Authenticated sender: flaupretre@free.fr) by smtp2-g21.free.fr (Postfix) with ESMTPSA id D856820036B; Fri, 13 May 2016 17:08:27 +0200 (CEST) To: Sara Golemon References: <452ddb93-1f47-1d0f-4f24-bedbff506b27@gmail.com> <98.61.11104.A1D41375@pb1.pair.com> <7c94ca37-e188-dd2b-a66f-bb63bf03041a@gmail.com> <1463008795.1856219.605250569.74618FC4@webmail.messagingengine.com> <92E7F8A8-0845-48A7-91B1-9554C5F66C9D@zend.com> <879feadf-c04e-c0de-826b-110b3eb4e22f@php.net> Cc: Zeev Suraski , Quim Calpe , "davey@php.net" , Larry Garfield , "internals@lists.php.net" Message-ID: Date: Fri, 13 May 2016 19:18:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 160513-0, 13/05/2016), Outbound message X-Antivirus-Status: Clean Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: francois@php.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Hi Sara, Le 13/05/2016 à 00:41, Sara Golemon a écrit : > So we'd have to audit all 4k+ functions in the PHP runtime (and > provide a mechanism for defining it on userspace functions)? That's right, except that, if we only consider functions accepting more than 1 arg, we just need to check about 1,000 functions. It may seem a lot but, for a potential solution to such a long-time issue as argument ordering sadness, IMHO, it's worth the pain. I am currently doing it and I'll send you the list when it is ready. For userspace functions, the logic can be quite simple : 0 arg -> not usable in a pipeline, 1 arg or more -> substitute first arg. Then, we have 4 options : - consider that, when using a userland function in a pipeline, the lhs is always inserted in 1st position, - provide a function to change the position on an existing function (default = 0 when function is registered). A negative position would disable using the function in a pipeline, - enrich the syntax of function declaration to designate the arg to substitute. I would propose to start with the 1st choice. After people have the occasion to use it for a while, we will see if an additional mechanism is requested. Regards François