Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124550 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 766351A00B7 for ; Mon, 22 Jul 2024 19:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721675334; bh=Az+j1wK2dZHXNZpConj7/B+aBpGCmV2RUFSihO3GiHk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=hNzbgtZQAtGCSV2BDUCSV3DfPrsOyvZX6YjRrfxjzJot/svV9apv2nHm8SjRheZR9 4bXPJKPWfuDDt1m/tgUtVeDopdsUuSF83pPfGBf8/+ZFxoeJ7b/4BdccohSk3yOMES dXZQYj8T97IkhoDsMi119Y4/WxO4TQbvIjSGXKEWj1oke09hR7EMyed74kLbJMCgUh MyvKjXrriF9nIqA98V/felRdn3OvRR/s2AXKry96cm2HcwhhbBDGwHxrHUt/0AbaO+ PVEZqA0pMUWzjzzD3LIql45KE+f7zI1qRupefC4Jqmb4CcNPklPEZkPOBkOIZorFoU vpe8/xA80PoUA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 66BC5180057 for ; Mon, 22 Jul 2024 19:08:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 22 Jul 2024 19:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1721675237; bh=tj64mT/fQ1yA4QrTmN+ntfndQ6Ud7ECQ3WA2D5wL/HQ=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=F14JWrPgXX74RCrr24AmwkuFtq8DUL4J00neYs7YW/ccf4NeHw4GA0dFs1sfOSqrC 5r4leDF4/8P303GnG88WcyTBsdBnXqBB6lDbaE1nACZINgPufg7i7dMZ52U0WsZBDY BF5QgJfgAncZRfk83c28C8CWdx6kfwf8XHMMYbQLv8hv55AgL2dVCLEXqGQWJn2W1V iM4/d9obCXu86x+gEiJh4XFmMleqntaRgds/7kJr7/hbp9rSDulroA6T8/IcqO75vj WJFzWIiletszfC2CbXyj3u/VCqUMmSxY9dlCen0EgItXCpeH6H/AGwmyRBnTChvxXO 0LgCWsZmVy6Sg== Message-ID: Date: Mon, 22 Jul 2024 21:07:15 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2 To: Larry Garfield , php internals References: <0a6a61cd-f203-4dea-a7f8-97e6b885c52d@app.fastmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 7/20/24 03:14, Larry Garfield wrote: > Baring any new developments, we plan to start the vote early next week. I've went through the RFC once more. I have the following remarks: > For that reason, a private(set) property is automatically final and may not be redeclared at all. > I assume that explicitly marking it as final is still allowed (just redundant)? > There is one caveat regarding virtual properties that have no set operation. If there is no set operation defined on a property, then it is nonsensical to specify a visibility for it. That case will trigger a compile error. For example: > How does this interact with inheritance? Consider the following example: class P { public $answer { get => 42; } } class C extends P { public protected(set) $answer { get => 42; set => 'dummy'; } } This could be considered to be both narrowing the `set` visibility from `public` to `protected` (which is unsound), but also widening it from “never” to `protected` (which would be sound). > as it's possible now for a property to be visible but not writeable. For the time being, I dislike the “for the time being” phrasing, because changing that would effectively result in a breaking change, because the __set() may be called in situations that were not anticipated. I would have preferred a stronger phrasing that makes it clear that the RFC authors know what they are talking about. Best regards Tim Düsterhus