Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114325 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49030 invoked from network); 10 May 2021 08:24:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 May 2021 08:24:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C844F1804B5 for ; Mon, 10 May 2021 01:31:53 -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-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 ; Mon, 10 May 2021 01:31:53 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id d24so4127869ios.2 for ; Mon, 10 May 2021 01:31:53 -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=8OyiYFvmPM48tUbaTKfSlHrP7GBvcNZeGaoHt+07yqY=; b=lX5H/jjeAZ8QYi+s6YATRsOvJ1QPPJM1HdzJ3n8F5231ZTHMG+nW04wMAgdJonw/+0 +vg+yHte+Yk6rlTGKiIZ4R2lMTAVZXBByNtvQnswtn9lBCzFx7uq7SocHX9fjrIJmAWO QsTQE0gu2AglQ1ekafu0EaxoX90s8iJqUt1khHFFS/8NYFDOzrMB8XkxFG313FyyxL5V iNtcpCBb6X//orV7/4SX/Fn/omcqesckMmB+jMB/nCrtG5EjFWzWoyQdzYOD6QKZVqlZ IPzx0a8o8N+fiZBeSp2xL3p74aGOQujYMLmf0x/M7GQa7tWZ0y8hwlHHQiAHQGsYh3cZ uy4w== 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=8OyiYFvmPM48tUbaTKfSlHrP7GBvcNZeGaoHt+07yqY=; b=Qk4hUspP+LmE3hnVPTNsE47q6t0W7gqQGexFLGx9Ja2QhN1Ac6vmNl83tbP2YAC8eD 2P5Eic2uhJyjKitgYewPJHF3X2B/djs2X0ol2v1Uy0TS2j6/4wNEDKAcboVnP2bM/UCQ A596o5z4pLPW5YEH5ie5/Lrc2zJSPUmvADyQ1cxQ+0i60EpXJv+cfOn8G3rQow8HBLK6 Cl78uyYGJMieWfgisTULhxqikIW7tWaTyVUf7Ydt/Sw9QAAnjsCoD/aRHLrqPRwtSdrI V7K5s/QYOV2zfh3OsDe/clSbW/U4KRLa0/IpbvN8yGG8kOFDUT3ZY0gAyOawdpV6uzQF 8KaQ== X-Gm-Message-State: AOAM532V+tnmsfnBOdf9gbVKwRg/kBdcjA3YvPSkUzpdiBD53Ry//YYv KwLyUuDH+FjYAcdkh4baQYuHlAgE5a/tZl/CeFY= X-Google-Smtp-Source: ABdhPJwrEGdf/WrRgCCpVY682WKOEs7HpeGF3LYjovzXeUFm6Wkp/cW1p0Ho4k61skqifbuwIKmnMgKgfjZ2hphNfnM= X-Received: by 2002:a05:6638:37a6:: with SMTP id w38mr20130056jal.106.1620635512367; Mon, 10 May 2021 01:31:52 -0700 (PDT) MIME-Version: 1.0 References: <1620635361.9147.0@gmail.com> In-Reply-To: <1620635361.9147.0@gmail.com> Date: Mon, 10 May 2021 10:31:41 +0200 Message-ID: To: =?UTF-8?Q?Mat=C4=ABss_Treinis?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="00000000000006721b05c1f59c6b" Subject: Re: [PHP-DEV] [RFC][Draft] Body-less __construct From: ocramius@gmail.com (Marco Pivetta) --00000000000006721b05c1f59c6b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Mat=C4=ABss, This already works by replacing `;` with `{}`: https://3v4l.org/tN4HM Is the change in AST really necessary, considering that? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Mon, May 10, 2021 at 10:29 AM Mat=C4=ABss Treinis = wrote: > Hi everyone, > > Since constructor property promotion is now implemented, and it looks > like it could become a widely used feature, I am proposing a small, > cosmetic change in syntax for constructors in concrete classes to do > away with empty constructor body. > > Here's an example of how this would work: > > namespace App; > > class Foo { > public function __construct( > private Bar $bar, > private Baz $baz > ); > } > > Some notes to this: > > - Since this is similar to already existing syntax for body-less > methods, parser should not be affected that much. I hope. I really have > no idea. > - Syntax would be optional - meaning, you can as well continue using > empty body, just that in this case the body would be implied empty. > > Thoughts? > Regards, > - Mat=C4=ABss > > --00000000000006721b05c1f59c6b--