note 80770 deleted from language.oop5.reflection by danbrown
| From: | danbrown@php.net | Date: | Wed, 16 Sep 2009 16:15:15 +0000 |
| Subject: | note 80770 deleted from language.oop5.reflection by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160716@lists.php.net to get a copy of this message | ||
Note Submitter: krowork
----
Like Will Mason said for the ReflectionMethod's constants, there is filter constants for
ReflectionProperty too:
ReflectionProperty::IS_STATIC
ReflectionProperty::IS_PUBLIC
ReflectionProperty::IS_PROTECTED
ReflectionProperty::IS_PRIVATE
that can be used in the ReflectionClass' method getProperties:
$class=new ReflectionClass("Foo");
$class->getProperties(
ReflectionProperty::IS_STATIC |
ReflectionProperty::IS_PUBLIC );
this obtains the publics (static or not) and the statics (public or not): this exlude the non static
private properties.