Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118376 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29034 invoked from network); 7 Aug 2022 23:09:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Aug 2022 23:09:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B80B2180380 for ; Sun, 7 Aug 2022 18:10:43 -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=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL, STOX_BOUND_090909_B,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS36483 23.83.208.0/21 X-Spam-Virus: No X-Envelope-From: Received: from dragonfly.birch.relay.mailchannels.net (dragonfly.birch.relay.mailchannels.net [23.83.209.51]) (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 ; Sun, 7 Aug 2022 18:10:42 -0700 (PDT) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8F14A21F43 for ; Mon, 8 Aug 2022 01:10:41 +0000 (UTC) Received: from nlss2.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 8124E21BC6 for ; Mon, 8 Aug 2022 01:10:40 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1659921040; a=rsa-sha256; cv=none; b=b+YHL8Is5v92rvx+J5am4fxbiHIoVDkqk9wQyP7uas+en9Jz+3tSksOKxR738PqZG8+k8L Gk44pLaPVInKvtYUyBOgnHf/TtJk1SKhgbJjnhF2WOe31bc2TLgwgIgrdyUU0KvbOegf3g xdB9tTm0rQ7tsFv7MP4Zhg+ys9JqziXUPd+G4FpnxOPf9nP3CknjsirUrdjd6zZkI1OpsD 2gy7Jgo5eqN1PGa9Ed9uj/a0ta4YUzvbg4p0ixRDhvRbNTrHYF8vZEZiVTHRE4N9MaN93w Eercw+w862pMLaw1+AdsKbe0OEWkyhQjMGpAXKM+Wg4SN0DPH385QVnxRclw6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1659921040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KjI7TOIdnb8T/TU8fBP7+gmxdO6MOowALKA0erg55rc=; b=kbX3n5RaIQvYoWowKUHyEJSliIA/UZGxvGPV9DtpThYlR5gQvCcTL/keIjElGyeN4GnF52 329TTBKHX3y5xpfH+Tvl50JY7dDWJIBdguW+Y/EWZaWQgrVpu/D8ty5yLyHCXLu4iBLio+ uGQ+cC8L/susRNSXYTO+Xyq6V60rxG0zZn6O7IOXOM++V67HvinDObwm/CS1ZlYId5PrGI ZmBZ55AiAhuyYZdOIMnnOjmCwAQ2RyLDz0mE23Vqb88KrbhS7vlCirTyG+ts5xKKLLbitG 0ADispiFT7GK8lJ8bfv4Wzn5ASZubBgZSBs0iBQ+91T+nb9iYzvZra+8HU7kaw== ARC-Authentication-Results: i=1; rspamd-7c478d8c66-lfdd4; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Blushing-Snatch: 4f7635f01ba01c2e_1659921041056_1427012793 X-MC-Loop-Signature: 1659921041056:286016186 X-MC-Ingress-Time: 1659921041056 Received: from nlss2.a2hosting.com (nlss2.a2hosting.com [209.124.66.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.110.28.208 (trex/6.7.1); Mon, 08 Aug 2022 01:10:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KjI7TOIdnb8T/TU8fBP7+gmxdO6MOowALKA0erg55rc=; b=p4yj5obXLvxuN5+IHg/b3CHNu6 qsiBSYX6o4xOB9mZoohS8i7d+lXPN1c0saYwwCtesm6Rul6CzuEEDLKzASqJZw8WMT9gTGrSzH5RT OdTGi5OKfrILxd/S2h6TTJBSdQ88p5C54Cj8vDt9KLbk/di0BTbDi4x4RvfCPJZ3cHtE=; Received: from 86-154-178-143.ftth.glasoperator.nl ([143.178.154.86]:61383 helo=[192.168.1.104]) by nlss2.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.95) (envelope-from ) id 1oKrHy-009HoS-Qi for internals@lists.php.net; Mon, 08 Aug 2022 03:10:38 +0200 To: internals@lists.php.net References: Message-ID: <62F0628D.9060704@adviesenzo.nl> Date: Mon, 8 Aug 2022 03:10:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------090406090200020907000202" X-AuthUser: juliette@adviesenzo.nl Subject: Re: [PHP-DEV] [RFC] Asymmetric visibility From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) --------------090406090200020907000202 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 5-8-2022 19:08, Larry Garfield wrote: > Ilija Tovilo and I are happy to present the first new RFC for PHP 8.3: Asymmetric Visibility. > > https://wiki.php.net/rfc/asymmetric-visibility > > Details are in the RFC, but it's largely a copy of Swift's support for the same. > For what it's worth, here's my initial thoughts after reading the RFC: 1. In "Permitted visibility, it explicitly states that the "set" scope MUST be more restrictive than the "get" scope. However, no reason for this is provided. Please make the argumentation to support this choice explicit. 2. In "Interaction with __set" and "Relationship with readonly" the RFC states it wants to be consistent with the readonly behaviour, but that is a different keyword. IMHO, these modifiers should work independently of each other and are now improperly closely binded. If one wants readonly behaviour, use the `readonly` keyword. 3. I only see a hat-tip to the property accessors RFC regarding the chosen syntax. I'd like to see a more extensive discussion and consideration of various possible syntaxes. Some potential alternatives: - "visibility(get) visibility(set) type $prop" - which makes it explicit what each visibility applies to - "visibility(set: visibility) type $prop" - where it is clear that the "main" visibility is the default and anything within the brackets a deviation. This syntax would also more easily allow for expanding, like "visibility(set: visibility, unset: visibility) type $prop" I understand the desire for parallelism with Swift, but I don't think that's a valid argument. The syntax should be right for PHP and if that would happen to overlap/sync with a syntax used elsewhere: great, but that's not an argument to only look at that syntax without a proper discussion and due consideration for alternatives. 4. While I see no mention of "multi-property declarations", I presume the visibility would apply to all ? I think it would be good to mention this explicitly in the RFC as well. * By "multi-property declarations", I mean: `public string $type, $value = 'me', $somethingElse; 5. Are there tokenizer implications ? How will `set` (and possibly `get`) be tokenized ? 6. As this is something which can already be handled via magic methods, is there sufficient reason to make the language/engine more complicated to support this via a syntax ? Overall, I mainly just see an idea in the RFC, but no justification for the need for it, let alone for any of the choices made. Smile, Juliette --------------090406090200020907000202--