Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110792 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62802 invoked from network); 30 Jun 2020 09:10:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2020 09:10:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C3D051804DA for ; Tue, 30 Jun 2020 00:59:44 -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-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 ; Tue, 30 Jun 2020 00:59:44 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id e4so21368990ljn.4 for ; Tue, 30 Jun 2020 00:59:44 -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=X22QYjp6GWIPVemuxBWuwlhRd+Bf+g1TTlXYr3npf7U=; b=t6gzI53nBhfrVnRTKMSZz/GDGayTeP0UovzZVsOpTR8YtQS7ltnSXp/SceX8/8/Tpr +6qU36RIhE8yJ3qKVlVEOYn6ijanKT0xjxGm0l+PXJMiay5G6eovi2Kns5uQ+mRyNPBp +KjnpF+jnjn/IVXM/jeshOnqDSBydYrDTvnQuxlktBN5l72/I4eIsbzixsVZrI/BsGJ+ HQqoO07H2yovmdc2zRMBXdu93JQ8KusnKI9dBHCBQMbplm5upETA9sehi3VRL5f4Eudt FVUZkj2KSIuOEPmVKnx7RoebWgPWAtC78N/PjZw16ufXys6JFIOiJWfYikP3Fe6ZZDB8 Gvlg== 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=X22QYjp6GWIPVemuxBWuwlhRd+Bf+g1TTlXYr3npf7U=; b=PjEyNXsFv/dan0f1oN0NQb9TzSRKMVj2rbOxEdbUpF3gMiO0xqdreqc3nv2FM9Q9FF lUjFKESEBQ/VS5D8BEIEvQ1Km5UJRBi1e202b+erL4UJbPo3VraDc3Q32z8VUAkJ5R63 MR3jGuHad8LqAZFIE4ktCIhN/Pqni/U5qyvEZSat10zAIE8m8Mu1hYET4etPx6fH86KD i3BenEcIs7GyB2SVBwXfOOWFkpqgIvTd22SXMKrgML0KhXa/dG93SB3GkzVdSg8gmsMn dZulgNeCKWyO4XqyzrGRi+QSg+QzWjSWVpe+abeTY+fzw5U/RxjFvFlhQpuoWJbUNAQA 04LA== X-Gm-Message-State: AOAM533AatODp+H1b+offQESd9th+GnIKnWsuE9x29/u40FRUmaZg+gb WnlpOCea0WTJuIBATA7pY5XjtP3AcdrLLmEbNtg= X-Google-Smtp-Source: ABdhPJytKgvSPJCzVLuFoT1g2BeTSVlOHc75tfkxPfJFo2dJdzT4mkn2AMj8/RSCeCmcW14HQ4R/aq27JijxF6LuArI= X-Received: by 2002:a2e:8699:: with SMTP id l25mr760275lji.81.1593503978997; Tue, 30 Jun 2020 00:59:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 30 Jun 2020 09:59:22 +0200 Message-ID: To: =?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000009dca5905a9488e4e" Subject: Re: [PHP-DEV] [RFC] Property write visibility From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009dca5905a9488e4e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 29, 2020 at 11:43 AM Andr=C3=A9 R=C3=B8mcke wrote: > Good morning Internals, > > I'd like to start discussion on a new RFC proposing a way to be able to > (optionally) specify property > write visibility, separate from read: > > https://wiki.php.net/rfc/property_write_visibility > > This enables readonly, write-only and immutable like semantics for PHP's > properties. > > These are the common use cases where users tend to resort to magic method= s > or setter/getter > methods. This proposal will as such avoid unnecessary boilerplate, makes > coding easier and more > ergonomic, and in the case of magic method usage improve performance. > I think this is a good direction to explore, but would recommend delaying it until PHP 8.1. As the RFC and discussion note, the design space here overlaps significantly with both readonly/immutability and property accessors. We should take enough time to consider these alternatives/extensions as well, to ensure that we don't end up with multiple distinct and possibly incompatible mechanisms. We don't have that time before PHP 8.0 feature freeze. Regards, Nikita --0000000000009dca5905a9488e4e--