Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110798 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97725 invoked from network); 1 Jul 2020 11:55:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Jul 2020 11:55:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D63EB1804E1 for ; Wed, 1 Jul 2020 03:44:45 -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-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 ; Wed, 1 Jul 2020 03:44:45 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id s9so26288194ljm.11 for ; Wed, 01 Jul 2020 03:44:45 -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=KIDVI6HPbuidmg1DdvjypIeuuypNR5KRaqdXgGL3KK4=; b=m25KWP3yXbEqIdX7dXr4smUqAh64m6S6P4CIthOS1PrU41JlYEAhmXnkLeyc/lcMPi kNNiicCy71hepTCY2AehRVsue/3Yn0rm/F+0D+v8UKCZ2GrJxTVr1ALDfzaUMKvGcRFn 2XwvBvknoBJNtaIiTRJVzXH9c8D2k7StDUys49YQzWdAoQIvftmBPIE+MUL/rcceqiiq ZAqVFxvrG00KFEI+b/wWPALT/6cyjjYmq3P4p+DuqmTZox0lojCsEh67pEYeVqR4O1BB OCnmc0zcVh3fPC/zuIXVd4AdFOIAKHT5km+c6esfKiV5EKxxP+H17vZQCE2oYNWvWArY vesw== 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=KIDVI6HPbuidmg1DdvjypIeuuypNR5KRaqdXgGL3KK4=; b=HyNC3PQnKQfa8HjlRgs5zo2jRl7qp5QS26L6Mtp+LZqGEi6/H3YLPzZ5zmJxzbIGzs TQfVPctl/OcShLJCAKLgrSFLQH2H5S79q5BrIl8rzZ7rF0CGhaZp+7tNRuN5Mc6suRX5 XXX0K5yUQ+ORgys0iFeuuLOZPs5CMJgdXOo5eUxYJc1PXeGOBI0nHHeNmfi/sZb94BTw pqVP5CDcjmEiP7KPbrkzEnlm5+1a8EbpUS9QrrgANoRW9z20LVs7YOrJR1UGCi+PwChT rpFJLLnvG31dbjtgQ12Ix3S8AhDL6YJ0qHUPUYJiRdRLnSie3ydTVp10qIrqax/bFJsn e7QA== X-Gm-Message-State: AOAM530cxsG6CJFUCRO4YPCHDca1b8OUDZTGqTnylImYE2zwm+9AZrvt hL1u/2LXXUNDFAksYxEBCYH6x9XNlnYgbRMt5eA= X-Google-Smtp-Source: ABdhPJzviPPpCcpcIvQHOLWQS+bLkQIIYb2/BMvhJ5H8czBnGWmoZFg5PnHCnQLvYVZaS9EDq+0766L4UrTnTpi2Q/U= X-Received: by 2002:a2e:850b:: with SMTP id j11mr13296110lji.30.1593600280693; Wed, 01 Jul 2020 03:44:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 1 Jul 2020 12:44:24 +0200 Message-ID: To: Dan Ackroyd Cc: =?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?= , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000a50f0305a95efa99" Subject: Re: [PHP-DEV] [RFC] Property write visibility From: nikita.ppv@gmail.com (Nikita Popov) --000000000000a50f0305a95efa99 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 30, 2020 at 1:26 PM Dan Ackroyd wrote: > On Mon, 29 Jun 2020 at 10:42, Andr=C3=A9 R=C3=B8mcke wrote: > > > > 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 > > > > From the RFC: > "Attempting to pass a property value outside of allowed writable scope > as a reference, results in an error." > > This part could probably do with having some details for it. > > Also, any implementation of that rule might need to be checked for > performance issues. > I think it would be technically possible, by extending the existing mechanism for references to typed properties. However, we definitely shouldn't do this, because it goes against existing language semantics. You can take a reference to a normal private property (i.e. private get, private set), pass it outside the class and then modify it. It would be inconsequent to assign stricter semantics to a weaker visibility requirement (public get, private set). Regards, Nikita --000000000000a50f0305a95efa99--