Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118391 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96604 invoked from network); 8 Aug 2022 11:38:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Aug 2022 11:38:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 66B1E1804C6 for ; Mon, 8 Aug 2022 06:39:52 -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, T_SCC_BODY_TEXT_LINE 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-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Aug 2022 06:39:52 -0700 (PDT) Received: by mail-io1-f54.google.com with SMTP id h138so7080111iof.12 for ; Mon, 08 Aug 2022 06:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=QtUASq4vapCvfXC2RDpBkuHpuS5InmRFaEKhdQzUA5Q=; b=L1Nw7uhBzdJPFdtYh62JlsELjGShoEzuVl2KShkcVh9jA++r1B7tEOOmeQpBDATT6x SQNTSXN8XssRrWCE2e6shLg42MlcO9Lta2Hp02pIKKYJPE99k5MuPRXslz0wiW6uRJqI hG4JRr/wJn3fPfukrHQPKZ7HSSTlJUSpAEBf7GUXb3h7qQtC5Ug2DbN1/gblYejvRZKd y7+pxNUnIR236vyIgrBPHQPlkTu/sM10yYOb07ys1baYMz9bX1hwGru6WPreL1cCn0QG PaNHAtXQBYd4AM4ygebNw9jnG6/x/eY2Glg4Z6yETtUY3Aftw8k8R1GEVSYQRCJQwfMd S8hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=QtUASq4vapCvfXC2RDpBkuHpuS5InmRFaEKhdQzUA5Q=; b=ellnCV0nUB55sRudg5GDrxdVK0LflMn6YOvPg8dsX/70c6Ocatec8o7S+roG6u7uc3 WZ8RJA+NzLiuTRZdUf63dmJ0BazWYcKdsjCczZ/mTi8TeMOeJ47JGMtw/jeUCr2n1Y7R fWJQmAAdi4wng3kI/tlggdRNdWPOuOl167qTXxoB4y5Yjm1PFcfaE4ljpAcBEIkAOvGn Wo8aN+ukcMlKbPXnXnw7XiPF7ITjLYakRxDAi8/PJoeeWQhEfoJyAOjYRvf9ZayJMtYd DVZUClIrNVC3JJeZBArEsqMNoMqYKfMdQoh3MnJOgjf/wFXyRmZLGS4Uq57Rlx97dyyi 5zBw== X-Gm-Message-State: ACgBeo0pyq4VnIM7VB3V5K3eKO3WD0PtrRL/pNALaFxWS3Fce2pE70AP gzz4o8sjGzsigKs/0qYVyIqC5S9ATHxWBFZx2io= X-Google-Smtp-Source: AA6agR68dKd3CTSaw4pUB1G9kWimm6g3vhDcHgIjhaKxJgeUrnob45f7kp3sp1v43eMCkrYW/YZUmH0gVY6/49KR6so= X-Received: by 2002:a05:6638:2586:b0:343:1c0a:8cf7 with SMTP id s6-20020a056638258600b003431c0a8cf7mr951607jat.255.1659965991305; Mon, 08 Aug 2022 06:39:51 -0700 (PDT) MIME-Version: 1.0 References: <578bd2ba-1594-fa0b-0f8b-3734af1f0383@gmail.com> In-Reply-To: <578bd2ba-1594-fa0b-0f8b-3734af1f0383@gmail.com> Date: Mon, 8 Aug 2022 15:39:25 +0200 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000004044d505e5baf393" Subject: Re: [PHP-DEV] [RFC] Asymmetric visibility From: kjarli@gmail.com (Lynn) --0000000000004044d505e5baf393 Content-Type: text/plain; charset="UTF-8" On Sun, Aug 7, 2022 at 10:38 PM Rowan Tommins wrote: > On 07/08/2022 11:54, Lynn wrote: > > Reading "public private", "public protected", or "protected private" > > reads really weird `public private(set) static self $property`. > > > Interesting, it seems that you've unconsciously broken it up as "public > private" followed by "(set)", rather than "public" followed by > "private(set)". Perhaps it's because of the position of the parentheses, > which do feel awkward to me at first glance. Would it read more > naturally to you with different punctuation? > > public (private set) static self $property; > > Or: > > (public; private set) static self $property; > > Or: > > public private-set static self $property; > The more I think about it, the more I agree with Marco's point of view on this. I don't think there's a way to add this functionality without it looking confusing one way or another. Once I get to use php8+, I'll probably end up using readonly for most code. I think the feature itself is nice for the scenario where you want to have private or protected mutability, but even this is a scenario I would avoid myself. I'm afraid that based on the future possibilities `package(set)` will make it even more confusing when allowing external modifications by specific classes, which would make it even more complicated to find out who or what may or may not modify a property from a reader perspective (like code reviews). --0000000000004044d505e5baf393--