Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119008 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85504 invoked from network); 15 Nov 2022 06:58:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Nov 2022 06:58:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AC15418004D for ; Mon, 14 Nov 2022 22:58:26 -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.9 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,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-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (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, 14 Nov 2022 22:58:26 -0800 (PST) Received: by mail-oi1-f182.google.com with SMTP id t62so13938480oib.12 for ; Mon, 14 Nov 2022 22:58:26 -0800 (PST) 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:message-id:reply-to; bh=/AyQywP6A8H5d0ZD4L5uIWOw0YKGVy+DB10gV2VBk8A=; b=kgKZenIScKN/dlVbF7+//WjWDWBVI+Fa61LIBn2vCs2nEXfposnj+kU/OUmC7nu5i3 +q3qNdqRyrkNLUIlZtmmSay0bSxTFMt4hHsU8cKSXFLc/E9PcVbbWl3Fvp7ZYfIlqa7O D0a6rJLuCBN1TSSB7n5/EZo5uErFb0BUWtUzIR9s67tE9Gt46zpKM70jWW/R3t2LqSaR zhywjTCW/5uJx5ftPqWaCG5JMB6bIynmN6UyzH//0OBimiwqE4Rl+a3SFyiK0UtH1dFC Avbwd3z0q/Dy0CT/dyUn+oL7wuyDqDk9E2We3Jx0x/2tu0Q/QPE92D13o+x2/QCroiqK ggog== 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:message-id :reply-to; bh=/AyQywP6A8H5d0ZD4L5uIWOw0YKGVy+DB10gV2VBk8A=; b=bBUBtJpTrkOivuxpbauqI4L47XKcNkUabPkFijborV7l6l69Yczm8fuCtab6zCVlF6 D0/zlhuc42g4401YiLWZ0wMqoX7uA0NWflAVGUHxo10FKvX3zIgBdDJ3ui0B0K1O4il3 hv/RI8Mv+F24CMofzWBAgObKr6uTVBfus6C5RvQ4AHfxBSopp+H1AQN96buQAQm5ZM41 L55RZnjzABknkeevrK9UtTlMw4v+JQsmiZ9V2KGwIxbzw46zuxHNFz9xSjOYKd37/52P ieLXB20Aln3wr+MdrPKqkEV6BXfkFlMJC3bMgJRzotU7uBB1bVLpWe6B96hfsApNVGFj pwrg== X-Gm-Message-State: ANoB5pm2M8zIkHNOHhHcrjIw1dsvW0N3nywQAf4HaMAA0CTup2d5wB1X zwWB2Hp8uDSAXbAjmvljpbiOtoGfOZTFhnUC4nY= X-Google-Smtp-Source: AA0mqf7WMMrL5MbeH6EKdxlMjidUe2bVvo89+u+9Ze47ojsIQMKicpWxJTJvZtKoF3TSSzmglcYGFqu8Qwrjp3N6Nvk= X-Received: by 2002:aca:1004:0:b0:354:4a19:f09e with SMTP id 4-20020aca1004000000b003544a19f09emr284871oiq.61.1668495505353; Mon, 14 Nov 2022 22:58:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 15 Nov 2022 07:58:13 +0100 Message-ID: To: Jordan LeDoux Cc: Larry Garfield , Nicolas Grekas , php internals Content-Type: multipart/alternative; boundary="000000000000e80af005ed7ce153" Subject: Re: [PHP-DEV] Re: Issues with readonly classes From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000e80af005ed7ce153 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, > If my default assumption (and Larry's) was that such a class would be immutable, it's fair to think that a non-trivial number of other programmers may make the same faulty assumption, and making this distinction obvious in the documentation would probably help. Yes, it makes sense to mention this in the documentation, but fortunately, the manual already makes the behavior clear at https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.pr= operties.readonly-properties : "However, readonly properties do not preclude interior mutability. Objects (or resources) stored in readonly properties may still be modified internally:" Following our discussion, Nicolas and I announced our proposal to fix two of the above mentioned issues: https://externals.io/message/119007 Feedback is welcome! Regards: M=C3=A1t=C3=A9 Jordan LeDoux ezt =C3=ADrta (id=C5=91pont: 2022. = szept. 25., V, 23:01): > > > On Sun, Sep 25, 2022 at 10:57 AM M=C3=A1t=C3=A9 Kocsis > wrote: > >> Hi, >> >> I agree with Tim, and I also think that both reverting and making any la= st >> minute fundamental change is not a good idea, especially >> because people don't have a clear agreement about how inheritance >> should work. Readonly classes is an optional feature, so anyone >> who wants proxies to work can simply not add the readonly flag to their >> classes. Of course, it's a bit more tricky for library code, >> but package authors should be aware of this gotcha. Having that said, I'= ll >> try my best to fix the current shortcomings for PHP 7.3. >> >> Regards, >> M=C3=A1t=C3=A9 >> > > I tried hard to make it clear that I don't think this makes it "broken", > it was just a deviation from my expectations and memory, both of which ca= n > obviously be flawed. I was mostly looking for some kind of information > about what the reasoning was for this, given that I obviously (since I > didn't remember it) missed that part of the discussion. The distinction > between "readonly" and "immutable" is subtle, but fair. This distinction > should probably be pointed out quite explicitly in the documentation > though. > > If my default assumption (and Larry's) was that such a class would be > immutable, it's fair to think that a non-trivial number of other > programmers may make the same faulty assumption, and making this > distinction obvious in the documentation would probably help. > > Jordan > --000000000000e80af005ed7ce153--