Re: [RFC] isReadable/isWriteable property reflection

From: Date: Thu, 04 Dec 2025 20:54:34 +0000
Subject: Re: [RFC] isReadable/isWriteable property reflection
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-129555@lists.php.net to get a copy of this message
Hey Larry, On 6.11.2025 00:24:52, Larry Garfield wrote:
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 while, but here we are. A strangely small RFC from us: https://wiki.php.net/rfc/isreadable-iswriteable
Have you considered returning false on isReadable() and isWritable() for methods, whose only statement is throwing? I.e. when a getter or setter unconditionally throws without any other statements present, they are not marked as readable or writable. Otherwise this essentially "punishes" providing better exceptions in a getter or setter, and serves also cases where the LSP inheritance forces presence of a getter/setter, but still shall not be allowed on the specific instance. Thanks, Bob

« previous php.internals (#129555) next »