Hi Larry, pon., 8 maj 2023 o 23:38 Larry Garfield <la...@garfieldtech.com> napisał(a):
> Ilija Tovilo and I would like to offer another RFC for your > consideration. It's been a while in coming, and we've evolved the design > quite a bit just in the last week so if you saw an earlier draft of it in > the past few months, I would encourage you to read it over again to make > sure we're all on the same page. I'm actually pretty happy with where it > ended up, even if it's not the original design. This approach eliminates > several hard-to-implement edge cases while still providing a lot of > functionality in one package. > > https://wiki.php.net/rfc/property-hooks > Using $this->propertyName directly is supported, but not recommended. Why is that? IMHO in the scope of accessor this is much clearer to me than using the $field. > The following example does make use of $field, however, and thus a backing value will be created, and write operations will simply write to the property as normal. This looks like new magic to me, whether we allow setting and baking the value explicitly or not. I consider this behavior confusing. Overall I vote yes. Cheers, Michał Marcin Brzuchalski