note 117476 added to reflectionclass.getproperty
| From: | dohpaz42 | Date: | Tue, 16 Jun 2015 04:16:02 +0000 |
| Subject: | note 117476 added to reflectionclass.getproperty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202872@lists.php.net to get a copy of this message | ||
Accessing private properties is possible, but care must be taken if that private property was
defined lower into the inheritance chain. For example, if class A extends class B, and class B
defines a private property called 'foo', getProperty will throw a ReflectionException.
Instead, you can loop over getParentClass until it returns false to look for the private property,
at which point you can access and/or modify its value as needed.
----
Server IP: 72.52.91.14
Probable Submitter: 71.75.115.123
----
Manual Page -- http://php.net/manual/en/reflectionclass.getproperty.php
Edit -- https://master.php.net/note/edit/117476
Del: integrated -- https://master.php.net/note/delete/117476/integrated
Del: useless -- https://master.php.net/note/delete/117476/useless
Del: bad code -- https://master.php.net/note/delete/117476/bad+code
Del: spam -- https://master.php.net/note/delete/117476/spam
Del: non-english -- https://master.php.net/note/delete/117476/non-english
Del: in docs -- https://master.php.net/note/delete/117476/in+docs
Del: other reasons-- https://master.php.net/note/delete/117476
Reject -- https://master.php.net/note/reject/117476
Search -- https://master.php.net/manage/user-notes.php