Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114349 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25802 invoked from network); 10 May 2021 17:54:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 May 2021 17:54:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EDD4E180211 for ; Mon, 10 May 2021 11:02:17 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.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 ; Mon, 10 May 2021 11:02:17 -0700 (PDT) Received: by mail-pg1-f178.google.com with SMTP id i5so9124592pgm.0 for ; Mon, 10 May 2021 11:02:17 -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=almjrKDS/77hW9xcEaEuP2uBR+MpHurYmyALCei/ZgA=; b=nXAf3TnFFvJkZqyYPswnfn2fEgjdenXAEp8pHk1YomVlui7lNnjvkVAz4ZlZkAOAwk AxJQsma7p4s2zg0bnpzBsJ8IYvqdCCCMQXRIfCkwH81v4oFn1v1dlMa+8d0Vlf9Vbhld Ibpq+TxYYahhTAANq/D1Xk5toe6tjKtay9M9gEPJB6mdVRyrxmr+soBIayAF22tWnktP mGVmaPwec/ksURdNl4ynhTfnu9NgHpoK2G86JCJM20nwJrTOkwYDnxMBtbXC2f71jRZp yx5Kpo8er4ysTGPoFxvIvcH8W3PNKy4ihXtjKk55a97qzQg6BXTU+vxPRX8ThNk0SgD+ jHgg== 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=almjrKDS/77hW9xcEaEuP2uBR+MpHurYmyALCei/ZgA=; b=OinrkftzHUTGn2sMTP4pgWCzONcEMOtWcqIktGdBNvJduv2WiNMdyEGzQGhOJa/e/S uIusKumVofQ3QSywMyzOM1hoJ5xdkoetujrqHuVqTN/GdjKyQfLC19kWZWIZob+ZnrpL cm2M53a6ffy+ty68SJseVqaaLqEqdbjO7U76YJ3nAdDhbfRdv/tX5pTRJv6VGt+wSkR+ sdFjXFXYFGgLFJUPASiux284i/WP1L5yPvdLTv2HL5EjbfTENlGq2gK9ozNjkBPXQrpp aFlhcbPr6Yizx8R5hdT1HaKVyNkdpoJRVLLkV4Uj2ETN2TiMYPljVbdIJj4EkiP3bkIh uWJw== X-Gm-Message-State: AOAM531ezO1dBlZy5cW26D+4h9D40Te/0V3/zA7wsJgUJkGyh9XtvKlI uvLQXJVtISzL8EB+ORSMJek4l0/cLvKmh+qoggiwpbkZaFafAC4M X-Google-Smtp-Source: ABdhPJzx4ztjuVsC2kYw/RmorEfq/Oil0a6hkROVcbGjgs33Yy1vbn2fzd36dsW9SsAa1R+gnzbmwdgaTaaWXv9NOYg= X-Received: by 2002:a05:6a00:87:b029:28d:f62f:a749 with SMTP id c7-20020a056a000087b029028df62fa749mr26321061pfj.54.1620669734188; Mon, 10 May 2021 11:02:14 -0700 (PDT) MIME-Version: 1.0 References: <1620635361.9147.0@gmail.com> <973730f8-1c9c-4208-b1fa-5f1048f6d6cf@www.fastmail.com> <4f7a4163-1eaf-404f-8d91-636722aa27b7@www.fastmail.com> In-Reply-To: <4f7a4163-1eaf-404f-8d91-636722aa27b7@www.fastmail.com> Date: Mon, 10 May 2021 22:31:42 +0430 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000ce21ee05c1fd9380" Subject: Re: [PHP-DEV] [RFC][Draft] Body-less __construct From: hossein.baghayi@gmail.com (Hossein Baghayi) --000000000000ce21ee05c1fd9380 Content-Type: text/plain; charset="UTF-8" On Mon, 10 May 2021 at 21:59, Larry Garfield wrote: > 1) Please don't top-post. > > 2) The reason is that the old way doesn't provide any way to populate them > on construction. The pattern of "assign the arg to the prop in the > constructor" is stupendously common, and promotion makes it vastly more > convenient. > > For more details: > > https://platform.sh/blog/2020/php-80-feature-focus-constructor-property-promotion/ > > The constructor isn't "supposed" to be empty. It just often is with > promotion, because the constructor wasn't doing anything else besides > shuffling its parameters over to properties, which is now automatic. > > --Larry Garfield > > Sorry for top-posting. Didn't know what it means :), also it was kind of my first reply to mailing list. Yes, I see now. I had forgotten that bit when I replied; apologies. I guess it makes sense now to end the constructor with a semicolon when it holds no body. --000000000000ce21ee05c1fd9380--