On Thu, Feb 22, 2024 at 8:25 AM tag Knife <fennic...@gmail.com> wrote:

> A few things i was interested to get the idea around.
> Was it thought about for the set{} for it to return the value to set the
> property to
> instead implicitly setting its own field?
>
> eg
>
> ```
> public string $name {
>     set {
>         return usfirst($value);
>     }
> }
> ```
> Where the value returned in the set is what the property will be set to?
>

The answer to this question is best described on the RFC FAQ:
https://wiki.php.net/rfc/property-hooks#why_do_set_hooks_not_return_the_value_to_set

-- 
Marco Deleu

Reply via email to