Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120031 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13415 invoked from network); 13 Apr 2023 15:20:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Apr 2023 15:20:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 850BD180546 for ; Thu, 13 Apr 2023 08:20: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=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Apr 2023 08:20:01 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id n19-20020a05600c501300b003f064936c3eso13394364wmr.0 for ; Thu, 13 Apr 2023 08:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681399200; x=1683991200; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=nqzYzOGVwgDh84tBapJATIzFwVmpb+147LXmSyZAIPg=; b=KSrSAUFBtuaWWxS9UJYCicmR1vtavHvU00tfCzG6G5ugpbxzLhwKzM0XrRqEcjZKqC 3O7ump9+EbUO7U3E1sUEmfNYIz55jhGAt48Qc5rR497Y0X2vaTqQczd3fg8rAG3RfOo3 ZMeLgeFOGMaU/yUcQXljci7KhhKID08jPXhCpcUqqigkruEvsvzgFP/BWOKXD8B7rX83 xj1JjCrKwyzFw6bX2UiSlVv9zUtKgRRLKRXmfokLYe6SnwCnQzaKOO24AC0fGrclBNUe Ec3xbJBFGPdtGJ8V+hvqOml2pJyN+XtXvixzferuJYi35W69UNeslZzkESGssjDXaljc k/wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681399200; x=1683991200; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nqzYzOGVwgDh84tBapJATIzFwVmpb+147LXmSyZAIPg=; b=Jy6CoM1MElRstWviJsdrWMvLAg7tYqmlv4iP9vIZ1ltjoKFAyo/hj3QXQF0ZGsw51O nRhQnojrG71Ki5Ea6HRFwT+vguWVBP+a6rBM3bisnTYFsK9pZo4UdK8d9L9G7KPLvyvx s8u00O8XA2/zuHxOoMIYiRIPpt39fhkgpWZT9rj6pa6+ODOeZdv5nnBNsYgzEjXqQ2Ag eeam7rsZZncpHB+Wp3065Xmcfg/Ekcg/Yn+diEwpKnGWFIuUNnGEwIcTgMFpx/UmycdV XB2F3mM250Ug2MVxF4F+4EAkENTKMUT7TdfDO0Ds1eKqRliYpEnPj+niCbTKQ7EnEPTT ciTA== X-Gm-Message-State: AAQBX9dozCt1S9SozmBfnCphXbrzkC6LbqAD6NvxPbziMPXC2vJtkZLX B0pQYSUOd+Y7Njg59L5/wkK+uehCcV4z1hxcFUWJqMNaLCI= X-Google-Smtp-Source: AKy350YF3QQKn6Vfrs6PB7HEn6ApRo3tFvwQl6g8Kic58Iz+qTwa80y4rpLCajMB7dRnKNNReTdccYx+u2TF4juPStY= X-Received: by 2002:a05:600c:b4e:b0:3ee:42fd:7769 with SMTP id k14-20020a05600c0b4e00b003ee42fd7769mr678393wmr.2.1681399199776; Thu, 13 Apr 2023 08:19:59 -0700 (PDT) MIME-Version: 1.0 References: <8a9a04b3-45e6-47dd-dee8-0f524e49bd37@gmail.com> <52a5a80d-f03f-5e96-4188-272a705e3fdd@gmail.com> In-Reply-To: Date: Thu, 13 Apr 2023 16:19:47 +0100 Message-ID: To: php internals , Nicolas Grekas Content-Type: multipart/alternative; boundary="00000000000007446905f9394251" Subject: Re: [PHP-DEV] Brainstorming idea: inline syntax for lexical (captured) variables From: rowan.collins@gmail.com (Rowan Tommins) --00000000000007446905f9394251 Content-Type: text/plain; charset="UTF-8" On Thu, 13 Apr 2023 at 13:40, Nicolas Grekas wrote: > > I created this draft RFC to help move things forward: > > https://wiki.php.net/rfc/syntax-to-capture-variables-when-declaring-anonymous-classes > > Please let me know your early thoughts and I'd be happy to move it to > "under discussion". > I'd also need someone for the implementation as I doubt I'll be able to > write it myself in a reasonable time! > Hi Nicolas! Thanks, it's really encouraging to have some interest in the feature. The good news is that I have an implementation of this nearly ready (it passes all my tests, but the code's a bit messy). I was hoping to polish it over the Easter weekend and draft a PR, but wasn't feeling very well. It has full support for visibility, types, references, and property renaming, but no merging of parameter lists or automatic call to the parent constructor. I think with clean errors that's a good first feature set, and if someone comes up with an implementation for manipulating existing constructors, that can be proposed later. So, "watch this space", as the saying goes :) Regards, -- Rowan Tommins [IMSoP] --00000000000007446905f9394251--