- var_dump: documentation ( source)
<?php
class Foo {
public static $staticProperty = 'foobar';
public $property = 'barfoo';
private $privateProperty = 'foofoo';
}
$reflectionClass = new ReflectionClass('Foo');
$reflectionClass->getProperty('privateProperty')->setAccessible(true);
var_dump($reflectionClass->getProperty('staticProperty')->getValue());
var_dump($reflectionClass->getProperty('property')->getValue(new Foo));
var_dump($reflectionClass->getProperty('privateProperty')->getValue());