- var_dump: documentation ( source)
<?php
class PhpClassWithPropertyDefaults
{
public $propertyWithoutDefault;
public $propertyWithNullDefault = null;
}
$class = new ReflectionClass('PhpClassWithPropertyDefaults');
$defaults = $class->getDefaultProperties();
var_dump($defaults);
var_dump($class->getProperty('propertyWithoutDefault')->__toString());
var_dump($class->getProperty('propertyWithNullDefault')->__toString());
var_dump($class->getProperty('propertyWithoutDefault')->export());