Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110781 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15725 invoked from network); 29 Jun 2020 16:28:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2020 16:28:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 00D691804CE for ; Mon, 29 Jun 2020 08:16:48 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS 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-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 29 Jun 2020 08:16:47 -0700 (PDT) Received: by mail-ot1-f43.google.com with SMTP id d4so15852357otk.2 for ; Mon, 29 Jun 2020 08:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YNLfnjrSIpvtq73KFwaJSPlZ11C1Nt944fal3t8fKoU=; b=FHMjP2BNGT7n50RA3bqm09qp7xHozpYR7fPLeym8/rMCRqIrY0cqphwjGAFCr9thag 2DIjhIauuztbdBwjlxWF55ihddnjVJpNiKNNijb+2F6VNT495NXyQPOICzIpgWwFxfih KaA37skU/ZWo5eyEZWDGJtcclOC505nPV4XLaPCzbdeM7ApgsgTFAiOiPKQEaP3uonGT Uu8KMeyhHU0uSWuDsir9bRBJUU4Vv6GonLy11WaYhNx7lzskP52k2+SZpHhOQ3frMdrP d8QNQgXrSHZvCtyVYWVTX0xJsrfNdU0oRj32yN2ELNdIU4NbR7j10fs5srxzTsNhGpSn b9oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YNLfnjrSIpvtq73KFwaJSPlZ11C1Nt944fal3t8fKoU=; b=Nyji8N+/RJaiPs8P/Ae4QouMs35rMd/1NAT8crRlXP4ONnbpQA3bQDur6Ky5Ij1DFN UdIxE9n/L/e6JUbUp6bVETpXHAdFhx0TfrWm6zhx2/+7VNQatYCgyEhGz5RQLBeN1YLk VwwDvW8g7a095ypPjStv0YKDD+dhKu5NubJGpWyPMv4HqkngSEKk+J2ZvROqhGNc+b9j hk7HgPwQKHIot7b26/uL2iv0ldeCuaVgiFGRwQQsdBnuTKUHWl8cbpVFrEBmOwKJmO9i 3XqBA/+z8kfK0QP0XvfJdCCV4oZXYnYbKSOtpvnOzmvgAjlUUiYCqXez0dPsPmoCgRYw D9/A== X-Gm-Message-State: AOAM533kXdkAEvO3iHqtxSYCj9hj0mx0vL4MKRNlR98/C6uYtkugzzKy vGiPOMPM1rkcC2kIb4Sx/Y3w0fvDSyBopA798ms= X-Google-Smtp-Source: ABdhPJxXQgxY/xHPecNVZXaMkyTyKzytYuPyHxFIICQhchbqSAJfz6v0ALipt4bG+xANXj603IqCfk1UQ4jW9P8fKEM= X-Received: by 2002:a9d:7dd3:: with SMTP id k19mr2334969otn.43.1593443807064; Mon, 29 Jun 2020 08:16:47 -0700 (PDT) MIME-Version: 1.0 References: <5ef9f918.1c69fb81.58a86.e504SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: Date: Mon, 29 Jun 2020 12:16:32 -0300 Message-ID: To: Deleu Cc: Mark Randall , PHP internals Content-Type: multipart/alternative; boundary="00000000000016f64d05a93a8cfd" Subject: Re: [PHP-DEV] [RFC] Property write visibility From: david.proweb@gmail.com (David Rodrigues) --00000000000016f64d05a93a8cfd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable With all possibilities maybe we have: - public set:private unset:private isset:private get:private set:private could be readed like "set is private". Where: - public is "general visibility" for set, unset, isset and get; - set: affects write visibility; - unset: affects unset() visibility; - isset: affects isset() visibility; - get: affects read visibility; In this case, maybe we should think on possibility of usage like: class A { get:public $x; } That determines that $x is private, except by get. In counterpart, I do not know if it makes sense for isset mode, because if we have get:public, and $x is accessible, so it is isset by nature. Atenciosamente, David Rodrigues Em seg., 29 de jun. de 2020 =C3=A0s 12:03, Deleu escre= veu: > As a user, I would prefer the original proposed syntax `public:private` o= r > the Swift syntax `public private(set)` than the alternative syntax `publi= c > int $x {protected set; protected unset;}`. > > On Mon, Jun 29, 2020 at 4:22 PM Mark Randall wrote: > > > On 29/06/2020 15:13, Andr=C3=A9 R=C3=B8mcke wrote: > > > Would something closer to Swift be better? If so I expanded the RFC > with > > > that syntax option as well: > > > > Borrowing from the various accessors RFCs: > > > > public int $x { > > protected set; > > protected unset; > > } > > > > Then a future RFC can build upon it by adding the override functions > > while keeping the same base syntax. > > > > Mark Randall > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: https://www.php.net/unsub.php > > > > > > -- > Marco Aur=C3=A9lio Deleu > --00000000000016f64d05a93a8cfd--