Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123460 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 1DD6C1A009C for ; Wed, 29 May 2024 20:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717013404; bh=MJneYpWex32MNv6/cakTVaMfhDcnskomxyzRWVBBHWg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gkDgFYcsmAA4Nn2+KgZRzo97D+myo5Y8B5diNCpyBOs67teUdolJ00DqEgUHvKf9C Ylu00FDv6+B36YfUB+QXtMuLKgmr0IhaxdoHS+3zhMbin184HM5+wNJ4ROk2eLe/Ft pnqSEUulETChzqP/9WxVxq5+PxutTo6olSAPd0GEOUMDnS2658n0LP7VU5a9tnb8NR FnIZeHoihNVagFPXD3uYyBSpdVWYawEJRDqNveY7tz2jaPSpzHmOOq3Qzz9YjqPhbR ofQcN2GLQPFxfnvUFL0c1xn1TxVursyZ9Jx5uDwx21YpZHpko8/UuoePsK/d8eXYBu fNWFz8AxLDgzA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE40718070E for ; Wed, 29 May 2024 20:10:03 +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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) 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 ; Wed, 29 May 2024 20:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1717013340; bh=gitQ4m48VyF1qPCfeOScQsP2B40Bta03p7GFjzZzYhI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=SJ2OmnV0KIkzBL5BGc1RHJi53HqU+rgbXnD2w98Mk239oHQISmb3fiqVL563UZRKn RLdJSDPSRWcpNsFCcfOV14Pf+rvnexefxpSvEIKcmuJLMgyWvIukQdCjuvhaKiWhcp NjUy79NH6gjk/Ddzt21TOYMX2Nd87ozmPGHRaWWSFcJLQ4qEZyQlrVkuWVb8r/ixEH sGiVQnF+4yPQ69tvK1QEuK/CbM0/lOagXkSN0pmnJWU1epfXevYt5ivPsTf3sqSck4 EjeGbRt91vRTuPDWDjHjU9coirYp+tPg/NHYhm8VyldoE1s8SImCB+cMeDRsYTgQJY mW+PkFrppMXTg== Message-ID: <9ee56480-66f0-4f1a-9d4b-20a0b30e66fb@bastelstu.be> Date: Wed, 29 May 2024 22:09:00 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2 To: Andreas Hennings , Larry Garfield Cc: 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 5/29/24 21:53, Andreas Hennings wrote: > Is there a reason why we cannot just make it "public private string > $x" instead of "public private(set) string $x"? > We would define that the second visibility specifier is for write. > > The current proposal with "public private(set)" is less ambiguous, and > it is immediately obvious that this is something new, and not just > somebody accidentally added two modifiers. > At the same time, it feels a bit alien and cluttered. > > Other options could be something like "public:private" or "public-private". The variant with the parentheses is the most future-proof one, should additional operations be added. It would allow for: public private(set,unset,frobnicate) string $foo; Even if tools would not yet understand whatever 'frobnicate' does, they would know that this is an operation that may be performed on $foo and would be able to syntax highlight the visibility definition properly and they would also know how to autoformat it, without needing to add support for the new keyword. Best regards Tim Düsterhus