On Wed, Apr 6, 2022 at 2:37 PM Robert Landers <landers.rob...@gmail.com> wrote:
> > FWIW, I'd like to see option 2 only because of custom serializers > and/or object proxies and also because: > > > This RFC proposes that accessing an undefined property is rendered > illegal behaviour > > StdClass has *no* defined properties and thus would always throw. But > I also guess it depends on what you define "undefined" as. Does simply > doing $obj->prop "define" the property "prop"? > The RFC doesn't change the current meaning of "undefined" (or "defined", or "declared"...), just proposes to throw an Error (while it currently triggers an E_WARNING). First sentence of the introduction: "Undefined properties are those that have not yet been defined either by the presence of a property declaration, or by adding them to the properties hashmap through direct assignment, or by having them assigned by an internal function such as json_decode." `$obj->prop` alone doesn't define the property "prop", but `$obj->prop = whatever` does. Regards, -- Guilliam Xavier