Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118355 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39739 invoked from network); 5 Aug 2022 16:08:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Aug 2022 16:08:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF1F2180546 for ; Fri, 5 Aug 2022 11:09:04 -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-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (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 ; Fri, 5 Aug 2022 11:09:01 -0700 (PDT) Received: by mail-yb1-f173.google.com with SMTP id z5so4979087yba.3 for ; Fri, 05 Aug 2022 11:09:01 -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=RXnEdOKpbEYbmJ01JmR2lFZMedojuB8c3J1SbZKAeC8=; b=OKsJp25RwktjEMfDkE8+q+N6ykJeXiAm/bT2BaKRKrsTH2BOnWet/dN5yeaDQosYDy QILui4x06FpiHlCcrh5xVwnd0yV33EBrgLhTBggQdk6x1hXt4bDvumfp+1HZ+J6RinTE rred9lwF8NJnIxDNPaJ4of0GmaxPMFVIRuBOt1usi2aAvVR84Orq9woF7dLCllJfBA35 nCFHwhq4gF1F8QbHeU4uV96AW8CUZdBgz7t7A1ocgfMCNokdDcBtTH8xRcUdrKwO8xIz OCxTldGiCuee2CD9iL/1Q/17EccL3/CN+7gkKxb416T7S6j9TyMwNSjXuhNXVKRDTV9d e5Pg== 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=RXnEdOKpbEYbmJ01JmR2lFZMedojuB8c3J1SbZKAeC8=; b=ah0JWiJFDX5X3uotaYsxzZDFEz/rS3LRfVo86qOwpJw1mqTYFl0uR2WtXK24Qgl16i OjXAo5eodz/lJe+vCNryykVXlFyPx8pXQSbs9U7K+QqS26SQLfoFd8kqsZJIGhtF6AgU 1DDSqmG6sDgN0uqD5imnXU7uImWZUp2yOSk8pylWOxLuZAJzGgh4Kk+jxOPq1Ts1QtOl Y/2xW2mn4wc21up8gorVSbOwrZjJkyFVs6ryXtDTe+/C5Z6uy4crCfYAoQqUodXlgrGE WHqecnx90O77B+OlvYlN/x1CyViX2sugTgg930IP1W1CNQkm2P2+d3+yg/xZXZ7pIGOJ VFCw== X-Gm-Message-State: ACgBeo2/CuylMLeQutwJ+QvK8srXaJToJ0BZb6awhVxbOUVnrdlRrzV4 nQt2BZBYawYTR8H7jKKyKFiIHUnCH/GQJe2P3ZKkzBS0 X-Google-Smtp-Source: AA6agR740lnEpk7r/w4ZmSY1WJ0OSFO+t38uv6EVCsA9Ph9KG0Afr0KQamr+8hlu1MP2DEPQg+cEy+wSej74LgiwaOI= X-Received: by 2002:a5b:f4c:0:b0:676:d681:1820 with SMTP id y12-20020a5b0f4c000000b00676d6811820mr5957035ybr.148.1659722940412; Fri, 05 Aug 2022 11:09:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 5 Aug 2022 13:08:48 -0500 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="00000000000049f80b05e5825cbc" Subject: Re: [PHP-DEV] [RFC] Asymmetric visibility From: mweierophinney@gmail.com ("Matthew Weier O'Phinney") --00000000000049f80b05e5825cbc Content-Type: text/plain; charset="UTF-8" On Fri, Aug 5, 2022, 12:09 PM 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. > I have two comments: - For reflection purposes, having two separate methods feels like it will be cumbersome; you'd need to check both to determine if you'd need to make the reflection property accessible before changing the value. An isPublicSet() would alleviate that, or potentially a getSetFlags() method against which you could apply a bit mask. You'd need to add a constant for public set I both cases. - The number of items that appear to the left of a property is growing, making understanding a declaration increasingly difficult, and your discussion of future scope indicates that this is likely to get worse. I'm wondering if this sort of behavior could be indicated via attributes instead? Something like `#[PropertySetBehavior(PROPERTY_SET_PRIVATE)]`. Attributes have the benefit of being separate from the property declaration, arguably more readable (one per line), and composable. This might play into some of the future scope items as well. Overall, though, love the design simplicity! > -- > Larry Garfield > larry@garfieldtech.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --00000000000049f80b05e5825cbc--