Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115290 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35637 invoked from network); 5 Jul 2021 09:41:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jul 2021 09:41:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4A6211804C8 for ; Mon, 5 Jul 2021 03:03:17 -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.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) (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, 5 Jul 2021 03:03:16 -0700 (PDT) Received: by mail-ua1-f47.google.com with SMTP id y47so2786372uad.6 for ; Mon, 05 Jul 2021 03:03:16 -0700 (PDT) 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=6QYnxq4n6iCRwfpdDfQJkAERNAoocWfle1Wi3qULPBQ=; b=eRacZMlCFPuZEjoIbLU/Vi5UEVPdRFz77a3Mcw7UWCXOM6qKkMsKovZcoko0tm3FKR DVQlwttu/4D4O9ifojKPMI0sEVM6CfYHQWVqZE3S7L2ESD+PJ9Ng9u1NkWoHCYPGmelJ 9T5eTRNzvxOL2gtBoH+vdvW0uFOX0Rc5NW3k6fs1xyubFz/mxISwvmb+ZEma26z3yS/W D6gHuBhbuqPLdwaAu03BQhaXyQp5qbr75tr7ZozsU3Y44p+rbgynK90vf1yg5C8XAARb 8YBsmeDl3eKpUun2QbHB/v/yK8xsLrZDyo+bY6neJ8FJayNlg9a31tZKp5GchZrL6e1l Ml7w== X-Gm-Message-State: AOAM530hUkXdakSLKI6qisAfohCYk0oj0037ISZPR9ghe6N2EFbLYvbd ygeq/nFHgnGz7e+D6mK82PiyK0O2KdtJdCu4xQ== X-Google-Smtp-Source: ABdhPJxDqRDEhU8zfzaGLUXjVAlYCGDNTQMasSLyUqXb8I7KM+DD1PG/MXwmxirBAAmwx3XWjs5ugaFlV/ZPildx6QA= X-Received: by 2002:ab0:74da:: with SMTP id f26mr9099765uaq.26.1625479391214; Mon, 05 Jul 2021 03:03:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 5 Jul 2021 12:03:00 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000b3ff5f05c65d69ee" Subject: Re: [PHP-DEV] [VOTE] Readonly properties From: patrickallaert@php.net (Patrick ALLAERT) --000000000000b3ff5f05c65d69ee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le jeu. 1 juil. 2021 =C3=A0 12:23, Nikita Popov a = =C3=A9crit : > Hi internals, > > I have opened voting on https://wiki.php.net/rfc/readonly_properties_v2. > The vote closes 2021-07-15. > > See https://externals.io/message/114729 for the discussion thread on this > proposal. I think a decent tl;dr is that readonly properties as proposed = do > not play well with clone-based withers, so some people believe we should > either improve cloning first, or introduce asymmetric property visibility > instead, which does not suffer from this issue. > > Regards, > Nikita > Hi Nikita, As much as I wish I could access publicly a property, but being denied changing it: var_dump($object->property); // allowed $object->property =3D $newObject; //disallowed I feel that the "readonly" feature will be used instead of asymmetric visibility as suggested in "property accessors" RFC in cases where the latter would be more appropriate. I wish "Property accessors" RFC would have been open to vote for 8.1 as you probably initially intended to for the following reasons: - It doesn't suffer from the clone-based withers issue. - It provides a way to declare properties in interfaces. Maybe there are other drawbacks with that one that I don't see? Probably the much higher complexity of it? Although they are different concepts, I'm not sure we would benefit much from "readonly" if we already had property accessors. Just wanted to express my preferences. Thanks for all the work! Regards, Patrick --000000000000b3ff5f05c65d69ee--