Re: ReflectionProperty::setValue() and ReflectionProperty::setAccessible()
| From: | Marcus Boerger | Date: | Thu, 13 Nov 2008 19:01:11 +0000 |
| Subject: | Re: ReflectionProperty::setValue() and ReflectionProperty::setAccessible() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41905@lists.php.net to get a copy of this message | ||
Hello Sebastian,
allowing to read is more than enough. And ofr the record I did not like
that at all. If you need to write to a private variable, then obviously
your class design is wrong. And testing is no argument, as you can nicely
design so that this is not necessary.
marcus
Wednesday, November 12, 2008, 8:29:05 PM, you wrote:
> Currently ReflectionProperty::setValue() ignores the setting made by
> ReflectionProperty::setAccessible(). Is this intentional or was it just
> forgotten to handle ref->ignore_visibility in setValue()?
> For some code I am working on it would be really helpful if setValue()
> could optionally work with private and protected attributes.
> --
> Sebastian Bergmann
> http://sebastian-bergmann.de/
> GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
Best regards,
Marcus