Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118561 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28395 invoked from network); 5 Sep 2022 07:57:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Sep 2022 07:57:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8157B180339 for ; Mon, 5 Sep 2022 00:57:08 -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-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (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 ; Mon, 5 Sep 2022 00:57:08 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id t184so11691195yba.4 for ; Mon, 05 Sep 2022 00:57:08 -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:subject:date; bh=0DHVuyVTkbVXEiieVivyFqfnfcTJeB0EQlVmavJLi4I=; b=HjqIxSmQ5efa/fXFmMsea8aUSQb4wPf7l/M8Gka6heoqcd8P4pNe4VukOT/AsfHT/9 nytQMTxX3UKcN4s2OYdVsPRbxJOrO8Be1AkW/drokhtQFoUEzXtMv7y+ODEY9sqorOa3 2Peihi3w8rz7nJiVISd6OjZsZ9DaGFedQroObV5wXee/1/AW6AvF65SJXHdjc16oweAj nQKS0ps97N3ne1Qenael4Jh21CEgjwnvxMKjSTn7MZ0zup1cb64TRrHNmpoUi2cvjyH0 wepZa9DJnzrqI8vG0sADdxaXtfnCiFAQCw5fqovaoE0hypbEmPpJBM3JAdu+gDPHAUKc fkPQ== 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:subject:date; bh=0DHVuyVTkbVXEiieVivyFqfnfcTJeB0EQlVmavJLi4I=; b=qS3FilQjwlkPTK0W5LmHg2bJEnHuNKXHK5EYlifsqphLmuidym3Qe4eu3t1XI3hw6B xQiUYjRyk0K78fiWJKBH7znQpzMAQfcbpT96T1VSDd20l2HDieo7BNOuBKZXAtUghbXM Ksc7AQvpKOEL4Q9izoa1Qt1nCHJ2FEww4nKFIfAMdghQgqGdU0Wv8ZjlZKo8fMTvhNUq GxAICftyVrXjv1BOaSEi8crtBbcKoAtdW2rNxrq2mFjamKG9zh+69jV/8zyJKpinekU8 NiVGTPEdSHQbH9j0jvQY/KpK1WkV9P91U5bnF4E3nxhdH+33DB5L8vigAYxrmgbon4O6 1yFA== X-Gm-Message-State: ACgBeo1GcboPEkoIswgcODMhHXDqtX/PpbDp9MYuElBe9koIS+KVW3/m 43YGSY+jrAVPvktwS1DsPcmQ9qi3Br4mgwmw3ag= X-Google-Smtp-Source: AA6agR6epF3+jtsWUEHUtAawSJOXiAMyZjFIGCWi1pxwv+L2liJO1eWViP1Ot+mwEz51SnPpydJdEFT+21Pt9yMD+Tw= X-Received: by 2002:a05:6902:4d1:b0:6a9:139f:bac6 with SMTP id v17-20020a05690204d100b006a9139fbac6mr3200008ybs.543.1662364627560; Mon, 05 Sep 2022 00:57:07 -0700 (PDT) MIME-Version: 1.0 References: <74826B75-7648-432B-9E04-D9A44252C0C4@php.net> In-Reply-To: <74826B75-7648-432B-9E04-D9A44252C0C4@php.net> Date: Mon, 5 Sep 2022 09:56:56 +0200 Message-ID: To: Derick Rethans Cc: internals@lists.php.net, Marco Pivetta , =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Content-Type: multipart/alternative; boundary="0000000000001cee4e05e7e96dd9" Subject: Re: [PHP-DEV] Issues with readonly classes From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000001cee4e05e7e96dd9 Content-Type: text/plain; charset="UTF-8" >Hi Marco, > > > >IMO good as-is: can be relaxed later (8.3 or later), if anybody believes > >> it's a show-stopper. > >> > >Readonly classes don't really need to be lazy. > >> > > > >"Break things and move slow" doesn't feel right to me for the language. > > It's a new keyword that you have to opt into. So it's not breaking > anything. It just means you might not be able to use it for your use case > yet. > > (and before you say that third party code might add it, you can just say > you don't support it yet). > It's not like it wouldn't be supported *yet*. It won't be supported *by design of the language*. Readonly classes introduce a new concept that isn't backed by any language theory I've read about. Of course it doesn't break until you use it, but conceptually, it breaks a universal design pattern: inheritance-based proxy decorators. What I'm asking for is: what is the justification for this limitation? If there is none, we should drop it. Preemptively breaking universal concepts (decoration) by introducing a never-seen concept might be innovation for sure. Or it might be a mistake. E.g. do we know any other language that provides something like readonly classes? How do they deal with inheritance? Can anyone answer those questions? If we come to the conclusion that there is no backing theory to support propagating the readonly flag to child classes, then we might decide if we want to fix this in 8.2 or 8.3. I know I would prefer acting in 8.2, but that's a separate discussion. Nicolas --0000000000001cee4e05e7e96dd9--