Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119071 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33419 invoked from network); 1 Dec 2022 18:31:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Dec 2022 18:31:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 401E21804F8 for ; Thu, 1 Dec 2022 10:31:26 -0800 (PST) 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 1 Dec 2022 10:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1669919484; bh=sIFjDMUczPl+AQfeCaPoUT1bds7uaXiM21OkXjY9mXs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=kvaCvidPAq6c/kjYk1cOC1h1Y0AHoib+joVgywOF8ITfjrs/74b6hr1/o66YvGgn9 ZXZvpBL69yIizCUQRAYyAZd2w6J5hfHPCMYOh9pYC23OUUOAiNOAkbxjjdGz3fwnI4 7cbP1zW+amSWwDi1I218iun+TpsZ7X85SiklBk4Iv+mr18Rl8r4RP3i1orZLiYcvlc LDsf5YI5m4BfcRoURr2FUwHrE3UrRJeH8vMRGMnCWWKht0QvbAaTiOukbuOjojvkqb b6ccMef5p+1wmz3xJiqX+WlS2hIEa/nCW8LK3Hwxszzzn614fqb+1ezZQ/20rof1aD I0VTySx90gv6w== Message-ID: <454c5329-d5a3-5174-d09c-346b7d65435c@bastelstu.be> Date: Thu, 1 Dec 2022 19:31:23 +0100 MIME-Version: 1.0 Content-Language: en-US To: Larry Garfield , php internals References: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> <831b9906-dc0c-420c-b22f-8a0cc8a1ad64@app.fastmail.com> In-Reply-To: <831b9906-dc0c-420c-b22f-8a0cc8a1ad64@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 11/29/22 21:29, Larry Garfield wrote: > Thank you everyone for the feedback. Based on this thread, we've made two changes to the RFC: > > 1. We've moved readonly back to forbidden with a-viz for now. I've added a section to Future Scope where we really should sort this out in the future, but we'll do that in the future when we can all focus on the various nuances of just that piece. > > 2. I rewrote the section on __set to make it clearer. That also included Ilija and I digging into all the nuances that are already present. The text may still look a bit complex, but that's because the existing logic is already complex with readonly. Long story short, the a-viz RFC does not change anything in the way __set works vis a vis asymmetric visibility; it just inherits and continues what readonly already started, so it's consistent. > > The PR should be updated in the next week or two with the latest changes. Baring any major need for change, we expect to call a vote for it shortly after New Years. > Okay, then I'd like to officially "request" that the abbreviated form [1] is dropped: I believe 'protected(set) string $foo' is easily confused with 'protected string $foo' at a simple glance. Also any implicit rules are something developers will need to learn by heart, whereas an explicit 'public protected(set) string $foo' could reasonably be understood by someone without any PHP experience and some basic experience of OO concepts. Having two separate explicit keywords also makes it much clearer that asymmetric visibility is involved, because it's also asymmetric in the code. I believe the only benefit of the abbreviated form is saving 6 keystrokes (+ one hit to the spacebar) and I don't believe it's worth the lack of clarity for an important property of the defined property. Best regards Tim Düsterhus [1] https://wiki.php.net/rfc/asymmetric-visibility#abbreviated_form