Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109506 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36813 invoked from network); 2 Apr 2020 11:41:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Apr 2020 11:41:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 364BE1801FD for ; Thu, 2 Apr 2020 03:07:56 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 ; Thu, 2 Apr 2020 03:07:55 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id i20so2584290ljn.6 for ; Thu, 02 Apr 2020 03:07:55 -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=J0xif++ipU5F8nctsTFvj37xVPm1Ny/tdrDXsatL8x4=; b=PYnch9N5qq9PheP2B5rKHd91vRt3L9X8li1dBb7YvbPMyzYkUQ+KlGlt7WtwVE55Jv 2xkQVbm0FKbjeb5E/qroQ8p0mm2LHErNIGLg84hPrWp8EcRE8oDxG5mDzAGa1GOzqNsC kqIxYVu+ehTBoq7Gjl3Q8XIjo87GWYiZjdcUnJKlIcT3Ge1aPqMkpUr/VQOlAqCeCWwE GPSjDh45HQ1auBhYCc2i/TAsjLUksYHkwI71h7LmHnO+plYdF7SyXWPFhp4a+zUvPmhf klnJlrUbbMdUSr94ngAfiW19+Qt5De7jXQreTkKtWqooSfrlLCirqJTp3UFSrK/xksKH jbcw== 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=J0xif++ipU5F8nctsTFvj37xVPm1Ny/tdrDXsatL8x4=; b=ckAycdqKtQqaGKMBoIcXiRLRg9+KPw3KjUs+U/XaGCd/HWm7asw+KACJnCgNHG08kt sTtMYFd7WNbE9/k3Z6qPgk6NrDP3Sy3KswStfujZifuKK59IEoFDTOCd4ku3Vmwi0CCv EV23x1sORME1QCdzD/Phj2sFxVuhvb2DhfF2DdP4szQX6Gkk6CRFQMIon9gl4WONbYDU hg+eGFcZfLkGkmkB84PFfAxLm4nGTvj60wdBS9SYSiD3FtDiiIiQkRs+FhPu3KmwfFwj 91OefaE7DDFJiUzpPS5fBu8VuKvuAXcrQ9LM6ZXdgjFFCPun+w8sQ/yeSA4CHu0H5H6i CfCw== X-Gm-Message-State: AGi0PuY/PpVg+uVQy2WJUVNwO9iXA1rEEDyWyV97yUPyKNfzLEqO7pb6 D0sYUTTy58R3jSDznyY63TNBNjyzSA06Gm++bkc= X-Google-Smtp-Source: APiQypItRpAvUPrTdcmoJpUse5dnR1pXF8sYuO8lFe9TksEvW88ZcQrfYfPL0ZVeCym0m1X8Y78Dc/1wg7S/hVkvw8Q= X-Received: by 2002:a2e:b4d1:: with SMTP id r17mr1532135ljm.117.1585822072576; Thu, 02 Apr 2020 03:07:52 -0700 (PDT) MIME-Version: 1.0 References: <5cb01a17-ff6d-b072-30d3-6a891dcc5434@fischer.name> In-Reply-To: <5cb01a17-ff6d-b072-30d3-6a891dcc5434@fischer.name> Date: Thu, 2 Apr 2020 12:07:36 +0200 Message-ID: To: Markus Fischer Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000005022e605a24bf9eb" Subject: Re: [PHP-DEV] [RFC] Constructor Property Promotion From: nikita.ppv@gmail.com (Nikita Popov) --0000000000005022e605a24bf9eb Content-Type: text/plain; charset="UTF-8" On Thu, Apr 2, 2020 at 1:35 AM Markus Fischer wrote: > Hi, > On 2020-03-26 14:30, Nikita Popov wrote: > > I would like to submit the following RFC for your consideration: > > https://wiki.php.net/rfc/constructor_promotion > > > > This is based on one off the suggestions made in > > https://externals.io/message/109220, and some existing discussion on the > > topic can be found in that thread. > > > > The primary motivation for this feature is to close the currently rather > > wide gap between the use of ad-hoc array structures, and the use of > > well-defined and type-safe value objects. The latter is what we want > people > > to use, but the former is, unfortunately, what is *easy* to use. > > The amount of boilerplate this would cut down for e.g. projects using DI > and DTOs is unfathomable. > > How does this work together with reflection? Will reflection see the > properties _and_ the extended constructor definitions? > Reflection will see the state after desugaring. That is, it just sees normal properties and normal constructor args. I've made this more explicit in the RFC now: https://wiki.php.net/rfc/constructor_promotion#reflection Nikita --0000000000005022e605a24bf9eb--