Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108693 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45067 invoked from network); 20 Feb 2020 10:42:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Feb 2020 10:42:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7B6D01804F4 for ; Thu, 20 Feb 2020 00:58:20 -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=-1.8 required=5.0 tests=BAYES_00,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_H2, 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-ua1-f46.google.com (mail-ua1-f46.google.com [209.85.222.46]) (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 ; Thu, 20 Feb 2020 00:58:19 -0800 (PST) Received: by mail-ua1-f46.google.com with SMTP id 73so1285460uac.6 for ; Thu, 20 Feb 2020 00:58:19 -0800 (PST) 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=jDzf9tpiP3QIREvt4ADYztkT4GrxAmDKhIPMOp3RVOs=; b=ruKQd3G//MWpEoYblay2EXyKzHwPhVeolwUFD1wL0Xshq3oH8oOU51lPXDUbTr4WIK AMI5KVuK/elnx+m/A8d6vpkVMythm6pjazzACuIq1L0RdxXIO9E0rYBx+N2GhswEhgQ1 U5lxFjzQfGxNhjfQvlWk1ip+AGVpl7PTZcUo5HChCNCZDIWGQnnfrJde6FsEnAWZ0/ox YezR0WxbmRDFeykrmdiSXyDmb5nxnwC95J+LdMx8gnKm91DliXtkZ188UaeX9ND3PDIk +4TrFw/Ilxh1m8m8TjBOlfVuQ/J4ZPeFuC+GaEHJtvSHfWHnkznHiCQeYmKCrhgNsxUe oNPA== 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=jDzf9tpiP3QIREvt4ADYztkT4GrxAmDKhIPMOp3RVOs=; b=ShzsajKNvjHoyC+r3mabPbSJp9sgWb/Wr9shlsgUBWYEp3mDTAPIdvYFrz7l/+JIm9 uWmqLbZ+2XCDK3JWWX1rzxJW8qB5OdeD0PkBvmfJzCK3jGqQccQof1WZOuQtTuBMjc7L JGUPB3NdANaSt9ECcWyLRY6RZ1loaJRFEkYorVFnuwCODsPMV3Pi0/YP4d+LiG6FPX0p lXN5UNXj/Cj9Hh0jCz3yz/4CB3TeAZKj0q0j0kShoBNyyC1c2ud7BDpG1Yxa67j0/0xT LEVBvSxqzzL2x7p04OgfZ9CDtJQAU7iNjWnhrLlamsSO9iM16mLKeiXd83980OpAYuwe GwLw== X-Gm-Message-State: APjAAAVUVrh+VJCVVIWcp7ThXqDhgfat++KifFvT9nr5lXoJB/21PsfD jy3kHTW3hAm5aSQgbu0lR+dMcv9wy81WyHzrE85HUSAv X-Google-Smtp-Source: APXvYqyr3MWdCQ1MV2ALjIe5z3A1/zC5AB3dkcPxi4OzGKm1WJMjIDwUfG7b3GO6eIwVGYA6WIWpnEtGwothkU6MWTg= X-Received: by 2002:ab0:2a0c:: with SMTP id o12mr15347331uar.72.1582189093770; Thu, 20 Feb 2020 00:58:13 -0800 (PST) MIME-Version: 1.0 References: <65c78b5a-55a6-4f1f-b881-f1401aa7dbb1@www.fastmail.com> <75810945-7aa3-45a9-a2fa-eb71db695e9b@www.fastmail.com> In-Reply-To: <75810945-7aa3-45a9-a2fa-eb71db695e9b@www.fastmail.com> Date: Thu, 20 Feb 2020 09:58:02 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000e6dbd7059efe1a74" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Immutable/final/readonly properties From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000e6dbd7059efe1a74 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > I would expect that operating on one of these properties before it's > initialized will throw an error: > Actually, the RFC only says that the "immutability" of properties is guaranteed after initialization. We could of course change this premise, but that would make some important use-cases (like what Marco's ProxyManager has) impossible to do. Furthermore, unsetting properties could be completely disabled by another RFC, given there is a migration path for the legitimiate use-cases. As far as I remember, the "Locked Classes" ( https://wiki.php.net/rfc/locked-classes) and lately the "Rigid Properties" (https://github.com/php/php-src/pull/5170) RFCs try to have their shots at it. > Does that work currently or no? If so, this is pretty sweet. If not, it > seems to be of limited use. > No, it doesn't work, and it seems to be an unrelated feature for me. As far as I understand your example, it's the topic of the "Constant expressions" RFC. I believe the behaviour proposed by my RFC would be still useful in many cases where one wants to be sure that no unexpected modifications can happen with a property. My use-cases would mainly include objects storing different kind of data: events, value objects, data transfer objects. M=C3=A1t=C3=A9 Kocsis --000000000000e6dbd7059efe1a74--