Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129551 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 6A7BA1ADC15 for ; Thu, 4 Dec 2025 16:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764866852; bh=C177plKGY+g+LyuCK8Y8u7z2gl6I01FSNpkuJhpZNYc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oBcDwitkaRNA9S9+U/tkuAJJMZmCf5pOkrFu9KZEi5Z/9RTAJXOIzgtof07KkZL0d dSNTCJKk09PhaQ4ZsbmSjhYF7e23Fqjj5D0lJYFk74PvboOL5Ntq589PveqXqvYVdF q/TzY1r6yjaFPFOuZFrmn5twkHQKc4PS4W5+e5e2fPfGF6fkWn/c32hL7HJp69gs2e NuBQTNSY6sbMa1AjomZ8BLu9mmzhy5N7Pi6whjD10EWE7JZxL1W+6D0yexvBq9/Hos Dt/FrvcVtMlIUcq2gJBLuk+r+0NapBuvB5c1hKr1YmvMJ2ASp7aXkCJH4nbjT6CnFU mJgBNqpgK+ytA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6054C180386 for ; Thu, 4 Dec 2025 16:47:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 4 Dec 2025 16:47:28 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-8b2a4b6876fso144859185a.3 for ; Thu, 04 Dec 2025 08:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764866843; x=1765471643; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rd0OXb1V42UcgxhEh/XiSvxe1gP1sDeWDXHxWjVxQV0=; b=LV3MC7ML5hNHAlqpy8CrofOYou98/ahPCdqVVoZ8nJtMXzG29TWt8hAZxakb1BokpO McbESyYkfZ8auKqhrdiLjBF2WM3RhaMAoNLlxodDOwUgXANgc/Z+sX3VYmhXJZ/RpgMs 1sBiH33GEzOKBOiE9iouqaMnlAgk4Ha/abrWaj+6BJ/QKW0N3bLgFpswJmPDo4zmgx75 6r/hb/KoCsUhQlTOdZw/U4xv5fknW/XV8q4jetJa/pMbBvvAXQJAUywmhg/aTTy/6R9d GIpC3T/Gg+O9nSyMGgiQ6p9iDoLXBlpYqu3pSs6RLx+XSE/DLGepTtPZ14p3VkLZV87E yOSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764866843; x=1765471643; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rd0OXb1V42UcgxhEh/XiSvxe1gP1sDeWDXHxWjVxQV0=; b=oBgAFGhYWAGah6fs6nAyeLuTUKmwKX/W3rsQyT5xO6D1ZeR+G5A3WQqyrhcY5R0CHB 9GRzh2d6H1HHd7LxaGFHVUZQLjhSAJkXpbQIvej4qXLW+jE8qzsJECbFPETHhbCB34VG FRxPCebCxD3LGeeQRQ76JTuWRfFA6mUPKTcJo/OcJ2fWeyFhj11feYzs0EhZSWTn8PId 9quD8JfS6tTE7A5OUvvMul/C09pbeVDyyWSNMMKv2yYxPQ2iQrO3DcDHX6qdmshjtaXW 90/pbw9XrtNDItXGZD64AH4HtMBQq4PMHyE5RULKD/MoDn0seVKx3NwkBWshxhH8lW+r rROw== X-Gm-Message-State: AOJu0YwZ9ozXMBP6grxbr/e6wqSb/sydSEAzgA4vWz7x7eC5GLp5tVX7 8jCJ6e8Bwgmky+8trTKd1vMk0IjM5K3Hr0zi3ElYOkmJKAU0DEtVNX7WMvJunPYLRA57UU/7ojY rO8Cqds2gz0Xbql8J4Q2gSpTxxaiEJZb6T53W X-Gm-Gg: ASbGnctFs2XnkIe+2xo4xgFm5KDHO2ULoEsAfo9TRjv3MURfpb3D8Cet1UqctwnPDVf QFYqdhuuxUYnjt+Z5CafSmIvksaf5457HmdU124xYjdqjHlqMfja/E3A/BrYVxCCimp4fAuTR3o QwqXeBQdnB5ketB9inD7NBlWZrRyIYpWLfim7qYpnbLUMJA6oOjE43rX83CXs4lliPsmOVBnxVF lKhpOjg9eJ6+n4yb3kx+130YNjZYuIabRvfEY9FeI+n2RlOcfOCQoF7uSawAhg/pHZXXvq3xG45 UZbUHfsIjDDwcZ7Z4Lgj6grp0u/oSxDSW6UZOmJn31oTrDqd/RvGy/HIrKM= X-Google-Smtp-Source: AGHT+IETJvcl2vlsdKKq8jjkIm19ljhZ7R2Er4xJz0XWSG5KkMJ5AN86HHuRnfX5oNpJ+plqPaVqrQMKxSoR9XsmJA4= X-Received: by 2002:a05:620a:2a15:b0:8b2:e284:1bd6 with SMTP id af79cd13be357-8b5e744f9e5mr972008485a.76.1764866842648; Thu, 04 Dec 2025 08:47:22 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 4 Dec 2025 17:47:11 +0100 X-Gm-Features: AWmQ_bmMpnKuvulQUUg3FniFquu0PmR7nKRPwfGQOMuQ3qeqHmHzLgVhF5PZtOE Message-ID: Subject: Re: [PHP-DEV] [RFC] isReadable/isWriteable property reflection To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000003b64540645231543" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000003b64540645231543 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le jeu. 4 d=C3=A9c. 2025 =C3=A0 17:39, Larry Garfield a =C3=A9crit : > On Thu, Dec 4, 2025, at 8:05 AM, Nicolas Grekas wrote: > > Le jeu. 6 nov. 2025 =C3=A0 00:28, Larry Garfield a > =C3=A9crit : > >> In other news, Ilija and I said a year ago that we'd take a swing at > adding isReadable/isWriteable methods to ReflectionProperty. Took a whil= e, > but here we are. A strangely small RFC from us: > >> > >> https://wiki.php.net/rfc/isreadable-iswriteable > >> > > > > > > Thanks for this. > > I also think the auto-scope is [NOT] a good idea. You state that 90% of > use > > cases will need this but my experience doesn't back this claim. The > > only cases where I had to check for read/writeable were out of the > > local scope, so I'd say 100% of my experience goes against that 90% > > number ;) Joke aside, it'd be just fine to let ppl be explicit. That's > > better than "oops I forgot to give the correct scope" bugs. > > > > About magic methods, one unsets a property only to have __get/__set > > called. Existing code works with this assumption. This means we have to > > return true IMHO. Magic methods are just generic hooks also. Which > > means they should behave the same. > > > > Nicolas > > Well, the only people who seem to have an opinion don't like "static", so > we've removed it. RFC updated. > > As for __get/__set, that's so far one vote for ignore (Tim), and one for > always-true (Nicolas). Not a consensus. :-) > > Nicolas, can you clarify with an example if/how ignore would break > things? > > I think once we settle that question and the cooldown passes we're ready > for a vote, though at this point that means January. > > I can try to build a synthetic example but the gist is: A class that starts with only properties and no __get() should be able to move to a __get()-based hooking in a later version without breaking code that uses isReadable(). That on its own should be enough to settle the desired behavior :) --0000000000003b64540645231543 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Le=C2=A0jeu. 4 = d=C3=A9c. 2025 =C3=A0=C2=A017:39, Larry Garfield <larry@garfieldtech.com> a =C3=A9crit=C2=A0:
<= /div>
On Thu, Dec 4, 2025,= at 8:05 AM, Nicolas Grekas wrote:
> Le jeu. 6 nov. 2025 =C3=A0 00:28, Larry Garfield <larry@garfieldtech.com> a= =C3=A9crit :
>> In other news, Ilija and I said a year ago that we'd take a sw= ing at adding isReadable/isWriteable methods to ReflectionProperty.=C2=A0 T= ook a while, but here we are.=C2=A0 A strangely small RFC from us:
>>
>> https://wiki.php.net/rfc/isreadable-iswritea= ble
>>
>
>
> Thanks for this.
> I also think the auto-scope is [NOT] a good idea. You state that 90% o= f use
> cases will need this but my experience doesn't back this claim. Th= e
> only cases where I had to check for read/writeable were out of the > local scope, so I'd say 100% of my experience goes against that 90= %
> number ;) Joke aside, it'd be just fine to let ppl be explicit. Th= at's
> better than "oops I forgot to give the correct scope" bugs.<= br> >
> About magic methods, one unsets a property only to have __get/__set > called. Existing code works with this assumption. This means we have t= o
> return true IMHO. Magic methods are just generic hooks also. Which > means they should behave the same.
>
> Nicolas

Well, the only people who seem to have an opinion don't like "stat= ic", so we've removed it.=C2=A0 RFC updated.

As for __get/__set, that's so far one vote for ignore (Tim), and one fo= r always-true (Nicolas).=C2=A0 Not a consensus. :-)

Nicolas, can you clarify with an example if/how ignore would break things?= =C2=A0

I think once we settle that question and the cooldown passes we're read= y for a vote, though at this point that means January.


I can try to build a synthetic example= but the gist is:
A class that starts with only=C2=A0properties a= nd no __get() should be able to move to a __get()-based hooking in a later = version without breaking code that uses isReadable().
That on its= own should be enough to settle the desired behavior :)
--0000000000003b64540645231543--