- var_dump: documentation ( source)
<?php
class Foo
{
protected $var = true;
}
class Bar extends Foo
{
public $var = 'abc';
}
$reflectionFoo = new ReflectionProperty('Foo', 'var');
$reflectionBar = new ReflectionProperty('Bar', 'var');
$bar = new Bar();
var_dump((new ReflectionClass('Bar'))->getProperties());