Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129547 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 994761A00BC for ; Thu, 4 Dec 2025 14:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764857172; bh=Gc/yldAKHzTAO9vGftZouMEGb8Wyrs2Z8UwfyouUHlk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MjgCnG6GyFsgm96MSJse4rusGNDYcFTBTzOfylLIFrpMdj/jcjro/CmCkgxAsgm9V 1MoxF+wXrOZSqEwKV2oWFu4mxlrYwMwH03ZLeSHkmdgn9ae24WwN2iDgXaa3bUoeKT B+iGwUiUseKFk1bShK7C6aGOLopK/SG3V1WUzpe8Z/LORQibMbbvufki/Rw+dPgrbv 2EZVYnARpQBhqTPQc1kNQFXJcwHfJRAzEwjOr3uz/kQ295JmAaH3lEevfqi+W3L4EK YrhNtT1bGhf+yNTkmg2oYU5t3oSyWcGDWe6FWFAfmg4lkn6W7QwTO2iyGRFvGwko7e FwYwjkZYqsfYA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 24DC2180079 for ; Thu, 4 Dec 2025 14:06:08 +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, T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 14:06:07 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-8b1e54aefc5so74647885a.1 for ; Thu, 04 Dec 2025 06:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764857161; x=1765461961; 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=sNr0Vb9aXiyCEI2YAIGs4BnAogAC2kq0n53NXNujhzU=; b=jbguQdiGs0E9y37t+pREhpPUT/jLkq1XxTRZaG7mmxYzMYlWftNZEFDo7lGnGjaWAL W3IzM96Mh4xuFG0qNQJucYghT0D8zNSQ1CviE+en5mXaf+B5Vl0zieuArAERHmmNU+vJ sMbWzAw1Pz0FzriKGYQxOSbzxug4T8aDPRtf4t2y/tvdWnrEUJ8PiKWNwAqjp1n58myE fYvBQwHaibQCMJtrZbXeyw+dQhGVWw9XoywThxnNWqDckq31ovlsLU5PqzCgvxbecHEZ EsrW/PM8zqaol8LBGZIl1Fv2YZkUNnqZ89pZYY4AqQQE522+q1TmQUZlxcN/XTxYiKYt BQTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764857161; x=1765461961; 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=sNr0Vb9aXiyCEI2YAIGs4BnAogAC2kq0n53NXNujhzU=; b=kLb3AK5Uq1XfyNq+fhhRwnlDcczQvqRq1PZSfXLeKase0aH41KlMip8KuSbEqmc/vq 4I5BmquqFfTcjIDAzXGl9cRqqAuF2Jjx1deS2KVukEnpApmSFeMzb2ealUINX/DKpQ61 XRUEpT+heEyyHcM27Z9zUhc6rTBS2pYv9Aoqjf0HHR4GMQ1Oh9WwEmm4uTtiSNQcWMYa p7iQtE5BgxA4gYIwOJxGzrVzw80X54bxB2KXB7wsL0lNpPNZX7FWiKTiIJ9tAbg1ytFv kIym+w8V/eNcrpueaiIjB0m+VHuk5YXygXpF7NNxZ2fTQV0sHqbVaHwoA6vKY1KRCfzD cEuw== X-Gm-Message-State: AOJu0YyidO9j+hOWwtmHBOd0BaS+BnrtOAPScIjL26CrxnLjtBaTgbjK evLKWAbjrX4gUJ8MKMsrgtk9P57ilef3h2VGURRuPbMD0+QYnYnSYBGv2x6iGmc6KGGmlBEjzR1 2fYG4JYO0Li9KxXZIljUNtiMhoPEkgfY= X-Gm-Gg: ASbGnctMsT7B9tQ01q5UtW+QNu49/ww9C0UFm1/60jCdt5vegeZm6ZnFWxp9nsvNngg 7WY77QGzu3y3c8ilWUA9tKvBqNgE2heAvuvkKAnh9rb45CGddipZOaOnCCKoq9WFs9uzaBCWsdH idHsBmccW7TRQuBNMs4Zo6vP7d+j7AReu9081SiFo+57nw6qBLGrh6+4j2DNI9A6gD86i2HAIlb f69VJbS3fqmCG0AVQHP3SlFVDrdxruhv1LtuCDkk6ZfrIDTpMafd1W15uKAN7kMuQtHPuqh17Jm dwHmA131PPbjzn7QL/GiVuYFV0D/saIhFnrvxLKuZ1rZOM/DM5yI7D4fO1t2XbSQd3jGYA== X-Google-Smtp-Source: AGHT+IEo1SIC0Q7tcItl4k5onPCmzJpZwBAiO6zcQcIt8Lafdsl+6V4aBmNi8dhveGaq0jagvacAIgMlNR6Y3B/CIsA= X-Received: by 2002:a05:620a:3196:b0:89e:67a9:fced with SMTP id af79cd13be357-8b5e7072b8bmr868226985a.66.1764857159959; Thu, 04 Dec 2025 06:05:59 -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 15:05:47 +0100 X-Gm-Features: AWmQ_bkhIbEiaZa4IjIbVC7AYur6mg7gpQeGZDPjPnX1Zx6wHi_gFu69uJnBIiY Message-ID: Subject: Re: [PHP-DEV] [RFC] isReadable/isWriteable property reflection To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000194e5e064520d401" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000194e5e064520d401 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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 --000000000000194e5e064520d401 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Le=C2=A0jeu. 6 nov.= 2025 =C3=A0=C2=A000:28, Larry Garfield <larry@garfieldtech.com> a =C3=A9crit=C2=A0:
In other news, Ilija and I sa= id a year ago that we'd take a swing at adding isReadable/isWriteable m= ethods to ReflectionProperty.=C2=A0 Took a while, but here we are.=C2=A0 A = strangely small RFC from us:

https://wiki.php.net/rfc/isreadable-iswriteable


Thanks for this.
I also think the auto-scope is a goo= d idea. You state that 90% of use cases will need this but my experience do= esn't back this claim. The only cases where I had to check for read/wri= teable=C2=A0were out of the local scope, so I'd say 100% of my experien= ce 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 co= rrect scope" bugs.

About magic methods, one u= nsets a property=C2=A0only 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
--000000000000194e5e064520d401--