Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116472 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94984 invoked from network); 22 Nov 2021 15:17:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Nov 2021 15:17:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AED61180511 for ; Mon, 22 Nov 2021 08:14:02 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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, 22 Nov 2021 08:14:02 -0800 (PST) Received: by mail-pl1-f169.google.com with SMTP id u11so14528887plf.3 for ; Mon, 22 Nov 2021 08:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=eA5ml8JJ6NcfN8fsoCdOP0IE1rrUF1/0jjp8ACPrh0c=; b=Lc3QxWDADdiejKgBELsw/SRkTLg6Nvg716DPNCDJHJNHz0c36ex03taIjJHNvjE3FP Eo/0APTwZAlzp6jMYke/jQnBgCuoRqVzGhqIFP+t/bxkB6IDEaiQcJf4zufnLV6dxkYi phlZ/Vx31c1xm8mOpBK3fM6ySfXRQBgSkFW40W7fYUBQ6dKucmfKj7nV7v6Fwl6mLFeI o7jZmbdjQ67aTZSG4FgRoIA1zfb0bCDG0RTXtRvM31PHGLCuLmtbdWfH0enzectnKFC9 lHMhUYQJJJ/1LAt2JFg2PlxASjOC215fGRzk4bKBVzNy+fFksw7SF1H1Bu7nM2bYFRb5 KGgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eA5ml8JJ6NcfN8fsoCdOP0IE1rrUF1/0jjp8ACPrh0c=; b=djlj6vkPlT8iHDF6alfd7FxWjp9DGd/1Sm4fjOHjPoQpKgV2FgWyNy4fM1v/76p+bG 2+mHfUb6F1D5aJIR9WocgQlT5CAfPauHV9X/Rw+zzbWoyTi46bUylNjRkyNFvXvS/Jxs ONFw5PJYxRsGFxtmBN8UvqNlpm5Bhe9jojoiEQcjB6qPcGTbTQYK5ZpjRyBnRVFYqf+/ +6S1PjVbQKY4BEWGHDfk5LhoCpa+I9/TZfXkod5Pdnd89rZOk/aOhfTwgQe4J+tVsuwj p6VFeTvs9o1R/tQBylU/16IZcmdHieZu5VsjAMF9cLOHi5iiz5wwGvuZj0NCHjH5jU7p pWZQ== X-Gm-Message-State: AOAM5313k2Jp9sFvYB09h2hhwRuX/nMUilm5jjRhdkt6xn47anBR/Lur U8BvEPqFHO1Yv43uAyaQd0i8zuJa0rA08lDbGcgMTaHx2rCC1A== X-Google-Smtp-Source: ABdhPJxKTJ0nm20Hnot3KsI69su2IykTByqo79wka4jNQ2Hb9SNT5gAel77mttQxZVrw+DaSkaBPZ2ftP2m1M1hg73Y= X-Received: by 2002:a17:90b:1a88:: with SMTP id ng8mr31813334pjb.180.1637597640740; Mon, 22 Nov 2021 08:14:00 -0800 (PST) MIME-Version: 1.0 Date: Mon, 22 Nov 2021 17:13:49 +0100 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000a9525f05d162e913" Subject: [RFC] [Discussion] Readonly Classes From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000a9525f05d162e913 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Internals, I'd like to propose adding support for readonly classes: https://wiki.php.net/rfc/readonly_classes The implementation heavily builds on the semantics of the already accepted readonly properties RFC (https://wiki.php.net/rfc/readonly_properties_v2), basically the only thing I had to implement in the PR are the following: - Any declared property of a readonly class is implicitly treated as readonly - Creation of dynamic properties is forbidden Readonly classes would make it easier to declare immutable(-alike) classes, especially if a class contains a lot of properties. As a side-effect, one could already opt out from dynamic properties completely, which won't really be possible for quite some time, even if https://wiki.php.net/rfc/deprecate_dynamic_properties passes. Regards: M=C3=A1t=C3=A9 --000000000000a9525f05d162e913--