note 106104 deleted from reflectionclass.getdefaultproperties by danbrown
| From: | danbrown@php.net | Date: | Tue, 11 Oct 2011 16:00:25 +0000 |
| Subject: | note 106104 deleted from reflectionclass.getdefaultproperties by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183792@lists.php.net to get a copy of this message | ||
Note Submitter: vasilij dot syc at doNOTdoSPAM dot gmail dot com
----
To correct post above and accentuate main advantages over get_class_vars and get_object_vars:
1. In contrast to both get_class_vars and get_object_vars, this method does not depends on scope. No
need to have following method within class:
public static function expose()
{
echo format(get_class_vars(__CLASS__));
}
2. As opposed to get_object_vars, it does show static properties.
Disadvantages:
1.) Does not show private properties of a parent class.
2.) In a case, if both, child and parent have same properties names, only child properties will be
displayed.
Anyway, 'the issue' can be solved by using following function:
http://en.php.net/manual/en/reflectionclass.getparentclass.php