- var_dump: documentation ( source)
<?php
class PhpClassWithPropertyDefaults
{
public $propertyWithoutDefault;
public $propertyWithNullDefault = null;
public $propertyWithTrueDefault = true;
}
$class = new ReflectionClass('PhpClassWithPropertyDefaults');
$defaults = $class->getDefaultProperties();
var_dump($defaults);
var_dump($defaults[0]->name, $defaults[0]->getValue());
var_dump($defaults[1]->name, $defaults[1]->getValue());
var_dump($defaults[2]->name, $defaults[2]->getValue());