(PHP 5, PHP 7, PHP 8)
ReflectionClass::getDefaultProperties — 获取默认属性
获取类的默认属性(包括了继承的属性)。
注意:
This method only works for static properties when used on internal classes. The default value of a static class property can not be tracked when using this method on user defined classes.
此函数没有参数。
   默认属性的数组,其键是属性的名称,其值是属性的默认值或者在属性没有默认值时是 null。
   这个函数不区分静态和非静态属性,也不考虑可见性修饰符。 
  
示例 #1 ReflectionClass::getDefaultProperties() 例子
<?php
class Bar {
    protected $inheritedProperty = 'inheritedDefault';
}
class Foo extends Bar {
    public $property = 'propertyDefault';
    private $privateProperty = 'privatePropertyDefault';
    public static $staticProperty = 'staticProperty';
    public $defaultlessProperty;
}
$reflectionClass = new ReflectionClass('Foo');
var_dump($reflectionClass->getDefaultProperties());
?>
以上例程会输出:
array(5) {
   ["staticProperty"]=>
   string(14) "staticProperty"
   ["property"]=>
   string(15) "propertyDefault"
   ["privateProperty"]=>
   string(22) "privatePropertyDefault"
   ["defaultlessProperty"]=>
   NULL
   ["inheritedProperty"]=>
   string(16) "inheritedDefault"
}