Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78147 invoked from network); 3 May 2016 11:43:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2016 11:43:41 -0000 Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.171 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.213.171 mail-ig0-f171.google.com Received: from [209.85.213.171] ([209.85.213.171:35297] helo=mail-ig0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/20-03860-BEE88275 for ; Tue, 03 May 2016 07:43:39 -0400 Received: by mail-ig0-f171.google.com with SMTP id bi2so112510429igb.0 for ; Tue, 03 May 2016 04:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=PrkDxAWNUKdtQ3EWcrOl+GeAE4S/kbMB0otIrlXAbw0=; b=g2Kz8Oy3zOUV2nSM/bO68pGOcoF1inwnON4SZESOze37YAYEsDhfk7i0bJZ08rktDH IOpAeZmt8ztUieVoeiPINbr/+sNNhJO9Q735GmCpJlCqfhgCjhOFrp/j6bFKfj8nl6Tt l6rp28/GT3smt7Rc5uapVyxAUa70wgE2fIZYb91AKUIi25uPgdvXuEGH/Y7ij3ZhRxxp awnHTRDBuCK+1L2+wfQ4oZXj63G31YyqXpUPjUxo+JER1DVhm/REAzB8LfpoYF46uy9k KmxXBiqB/ND7yUk17Tz6Cm/XctGwm2A0oZHeAP7EWtUtTWYFaS2rnB5YIP5b17bvT9pn WBTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=PrkDxAWNUKdtQ3EWcrOl+GeAE4S/kbMB0otIrlXAbw0=; b=j/eEBpSPusuMq8FV3v7hmZ63uIQAx4FrnMc6Arzf1HninctlR/b8LIAuksVsBY47k5 SUNuTY2Itp+rGqq6VcZODM+oBtRNiH4Sl5WXZS5stRABCJ3QW+15MI82VKC/gkoPShHi VCvzNkz/Teu9GiyPTOHrjihwvt55J8m4pkGzaBNGmJhjAvwIAfetN/O5tKnhEyzdc6eq D8vA6l4TMXTlzhSNXezkY+hhmBQhZmeIkCZKwxPAk3N9eLPhvbFQB1PNwyWR/8/EOPLa I3t9NkHLZ5+olTfkLwFsi0ih+gsqoXmZ4nJr7uOCuTjsch0fXy77uwNKofTUHear6at1 F4XQ== X-Gm-Message-State: AOPr4FUW9nGg7HMj3QfI2EAG2izG0R9iAw7uYtfHLDoouK3jDuGGW6dRsG2KKbLRdBtpIzfYtJlxYBwJCAZf9Q== MIME-Version: 1.0 X-Received: by 10.50.13.74 with SMTP id f10mr26648980igc.55.1462275816534; Tue, 03 May 2016 04:43:36 -0700 (PDT) Sender: jesseschalken@gmail.com Received: by 10.79.139.133 with HTTP; Tue, 3 May 2016 04:43:36 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 May 2016 21:43:36 +1000 X-Google-Sender-Auth: mPWhfY804WYi0JM_y5duWGZMHCU Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: multipart/alternative; boundary=089e013c6f5e9bc7fa0531ee9ebe Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: me@jesseschalken.com (Jesse Schalken) --089e013c6f5e9bc7fa0531ee9ebe Content-Type: text/plain; charset=UTF-8 I am very much in favour of this. I would typically write the example with an intermediate variable to avoid all the sad nesting. $files = scandir($arg); $files = array_filter($files, function ($x) { return $x !== '.' && $x !== '..'; }); $files = array_map(function ($x) use ($arg) { return $arg . '/' . $x; }, $files); $files = getFileArg($files); $ret = array_merge($ret, $files); But it's certainly unfortunate that I had to revert from expressions without state to ordered statements mutating a variable just to avoid deeply nested parens. Anything that enables more code to be written declaratively rather than imperatively is a win in my opinion, especially if it can be implemented as mere syntactic sugar as is the case here. On Sat, Apr 30, 2016 at 5:58 AM, Sara Golemon wrote: > This is one of my favorites out of HackLang. It's pure syntactic > sugar, but it goes a long way towards improving readability. > https://wiki.php.net/rfc/pipe-operator > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e013c6f5e9bc7fa0531ee9ebe--