W dniu 04.05.2021 o 18:32, Marco Pivetta pisze:
> I'd strongly advise killing by-ref array push there: it's an acceptable> limitation, for the amount of benefit we get :P> In fact, people doing __get now are already familiar with "Indirect> modification of overloaded property" (https://3v4l.org/6dTXK)
They are familiar, but this is not a reason to cripple property accessors concept with the same
limitation as __get(). "Indirect modification" is
really annoying, and using reference to bypass it looks more like a dirty hack than real solution.
If we can avoid "Indirect modification" for
implicit accessors without involving references, then it is definitely worth it.
And this is important for explicit accessors too - in my case like 90% virtual properties are some
kind of conversion between string and array, where
getter returns array generated from string. It would be great to handle this too, even if it will be
only syntactic sugar, where
$object->property['key'] = 'value'; will be equivalent of this
dance:
$temp = $object->property;
$temp['key'] = 'value';
$object->property = $temp;
Regards,
Robert Korulczyk