Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119234 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75317 invoked from network); 5 Jan 2023 19:28:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2023 19:28:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 69971180511 for ; Thu, 5 Jan 2023 11:28: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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 ; Thu, 5 Jan 2023 11:28:20 -0800 (PST) Received: by mail-pg1-f176.google.com with SMTP id v3so25169157pgh.4 for ; Thu, 05 Jan 2023 11:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=4f19Vv+6iM87pCIu3b78UPHmaDybOwXPDlzPLYu3uRQ=; b=ASdWCxqeD6XMB/k+10p5+g74g6q4oALpQeRqKTkdMJPFUnO3tXS/qxiHhTRgGQFRx6 6ki4L1EdJGUd9NoP9z9RTzdCYmXjL5pX8OaRNQMzCBb+Pai/XMeE8EbClYKYHMnM2gz6 htQh04Y+zmG2fU7zBegr65FNsqJZBJ2u/g8vRu6BEL9IjE3GbaQyg9Qp+6afYvA/epYB M5djXZuBiCYCEkJho81I0W2PcTimZ8B9LKjsijOWn2O4Hs9d7LHxc8KnquF5rBiS7mXB K3IESi5SONuWA4ncWLijqWzbL2Xz8K6BWfPLeoYshbKZ+5mzApolrp7xj8B0JMR0ahgZ v0yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=4f19Vv+6iM87pCIu3b78UPHmaDybOwXPDlzPLYu3uRQ=; b=7uMjt56viGC9mek/JgP9Oqbj5Y5ZG3oKFNjJwh4w/xyK25sirsg4ephucJOx+ZRGYX +7qEQrJ4xHMMDkXyOe945UVUH6aSY30Ym8Y/vMRsUGWKVtqyjaMd2Bxl9WdISThV4YVK ipKyOTUJYwYJ84mgYI1eB9jYyl8zJNFtZmTzwOQ59MX62BFGcNDdeeksw7ChzH0ibVgi kgU8ovQEc0OY2JPVbPnW4xT1LBBushjk3Ia1O0K0EHrsOoAS/YOR6DTgEg0GLBy3uiPj fqoeVCqC39LYcmOzUb0PuQJrlhhcPiXIo2G2vGd6Cf5m4Rxhxw6tgZDXwI7UBtZa8KaL gF1g== X-Gm-Message-State: AFqh2koj8wHLYI9LP6hF8+JdZWTOIM+r8UKNaTuiyKCo3ZBhluXdG/SV TvxUzcM1KtnAv1uyglQ02b643JhFMCLAr4ty0ILhv2zG/CQ= X-Google-Smtp-Source: AMrXdXvzOv9fwzJ4Wjgb3LifHpcZU6JKhOC/suVC1aTYtJcMyI/hpqJV+DOEeYQAqDHA2rV18lOgIa4unY4nhZPz8eo= X-Received: by 2002:a05:6a00:4108:b0:581:e84d:c2b6 with SMTP id bu8-20020a056a00410800b00581e84dc2b6mr1848693pfb.39.1672946898540; Thu, 05 Jan 2023 11:28:18 -0800 (PST) MIME-Version: 1.0 References: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> <831b9906-dc0c-420c-b22f-8a0cc8a1ad64@app.fastmail.com> <454c5329-d5a3-5174-d09c-346b7d65435c@bastelstu.be> <8f9cf24c-ee77-4227-9b7c-31c631bf8a72@app.fastmail.com> <84647C1B-0F61-41E5-981D-B860BE1E53CB@gmail.com> <3d8561bd-fdb1-417a-836b-5146fca56185@app.fastmail.com> <845495d8-52da-4d2e-90ee-79c697d87f30@app.fastmail.com> In-Reply-To: Date: Thu, 5 Jan 2023 20:28:07 +0100 Message-ID: To: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Robert On Thu, Jan 5, 2023 at 3:54 PM Robert Landers wrote: > > One quick question, > > Will changing the property of a protected/private set via reflection > be allowed? Or will you have to do some shenanigans like you currently > have to do with readonly? Since PHP 8.1 ReflectionProperty::setValue() allows writing to any property from any scope by default (assuming it is not readonly) without calling ReflectionProperty::setAccessible() first. https://wiki.php.net/rfc/make-reflection-setaccessible-no-op Essentially, there's no change to the existing behavior. You can write to an asymmetric property using setValue() just like you could to a protected or private property as the visibility check is skipped for these cases. I added a sentence to the RFCs reflection section to clarify. Thanks for pointing this out. Ilija