Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113750 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37651 invoked from network); 24 Mar 2021 22:50:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Mar 2021 22:50:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3E64E1804D0 for ; Wed, 24 Mar 2021 15:46:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 24 Mar 2021 15:45:57 -0700 (PDT) Received: by mail-io1-f52.google.com with SMTP id k8so23245020iop.12 for ; Wed, 24 Mar 2021 15:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ID+znG6qs5CrLxcFvm4UfvJ6JdApoL4K9g9VC1mf40M=; b=owf3iHPapyW3LTcINzOVGaM02//iQ/G1vCzYIh9rAnAjGSW6UeJ9Se+/Q8kyIqJDtW qsmjQN6h/4H6uBQjdvwnvYQgOAKbrC0Rh7WpWk1V3AvByQd28r277E0A5sOtEM95qTCg 3dhR0lxdYp+a1swoKuFpb+Yp3EmoBNr0Z3HosiQyuc/nMlj1I80OexTtbm05LFQkyYkn +O25oFFWjJA+DDP9zt+sGsIzdEl+AZEbqoJNZFskNiQfjvvFLR1OkaRa6lnwsfoNnZ3y pqC/ZzwD3wQQiJ0aWdhbxg6t3937Tk4xL5GR3msNHPw6U7Tr1Gct9QzJQ7Ew4ysHvDF7 6bnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ID+znG6qs5CrLxcFvm4UfvJ6JdApoL4K9g9VC1mf40M=; b=jHRo43Zq3VW1jsAeYMwZk7/zP5bulq7IMrAtwGwSpRCtywYSBH4GScIr+Z+EdMDjlt AHpHvoX3VKDqv3eqV3KpMPz0UwO/sXPLZ+AvNBjm5zvJBBWJbqmN2txupFbQ3GY+z2vZ BmsWIPoYqQqqs/JbXD1J/2amyC5Xg0OVHnXWOaexeF+7urrIPAixjj+zVR1XctImGN7F 9EyeZYl6sOGbqq/ZEGOVEQSIpV1lra8tLVMT7uENMRWQ/xTY+PUjlXLC/CRF2ifAGHD2 A4K3fxuaL+utPJg75bl9oCHEhHxdM/sNRkfA4Aaf/Bm3nfk89SoGiM8fh+VkdCd/ajxe K0aQ== X-Gm-Message-State: AOAM533ehFHUAcqCig1Wlc455LOS4ofgswahc2f9CFn4gtyx/eTukP9v 9VAOdbCh7vtlIzGY14zgqNY3D5u2/4regEtPb8gDSEB0 X-Google-Smtp-Source: ABdhPJxn2WdLaGaXcO6z5XITm/xF5eAu/8fIxXNa9/2MU8BHc60c+VGShhHYY4sIBKq5iNd3CZij2o5toP5YIrjGmHk= X-Received: by 2002:a02:942d:: with SMTP id a42mr4959978jai.71.1616625954670; Wed, 24 Mar 2021 15:45:54 -0700 (PDT) MIME-Version: 1.0 References: <88c9eb5f-f80c-4869-b7f8-1b58b9e2eaa3@www.fastmail.com> In-Reply-To: <88c9eb5f-f80c-4869-b7f8-1b58b9e2eaa3@www.fastmail.com> Date: Wed, 24 Mar 2021 23:45:44 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000c34fea05be500fa5" Subject: Re: [PHP-DEV] [RFC] Auto-capture multi-line closures and short functions take 2 From: deleugyn@gmail.com (Deleu) --000000000000c34fea05be500fa5 Content-Type: text/plain; charset="UTF-8" On Wed, Mar 24, 2021, 17:20 Larry Garfield wrote: > Greetings, Internalians. > > Some months back I proposed an RFC for short functions. > > https://wiki.php.net/rfc/short-functions > > After some discussion, I put it on hold to ensure that it was compatible > with the other discussion floating about around an alternate syntax for > multi-line closures that did auto-capture. It's important that the syntax > of both proposals is consistent. > > Nuno Maduro and i have talked recently and worked out the syntax that is > consistent between both proposals. That takes 'fn' off the table for > short-functions, for reasons discussed in both RFCs. > > To that end, I offer: > > 1) The updated short-functions RFC: > https://wiki.php.net/rfc/short-functions > > 2) A new RFC, code by Nuno, for auto-capturing multi-statement closures: > https://wiki.php.net/rfc/auto-capture-closure > > These are separate RFCs and at this time we plan to send them to separate > votes, but I list them together to demonstrate that they have been > developed in a mutually-compatible way. > > Further details in the auto-capture-closure RFC. > > -- > Larry Garfield > larry@garfieldtech.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php These RFC are an amazing addition to PHP. I have been working with PHP 8 for the past few months and small syntax improvements such as short closure, private constructor promotion, nullsafe operator, etc. are game changers to my day to day work. These RFC close some gaps that are natural expectations like short closure with multiple statements and the ability to simplify even further simple methods on Data Transfer objects. I wish the best luck to both RFCs and hope they get approved, if not for their wonderful merits, maybe at least for the sake of consistent syntax throughout the language. --000000000000c34fea05be500fa5--