- var_dump: documentation ( source)
<?php
class Foo {
private $bar = 'baz';
private function taz() { return 'waz'; }
}
var_dump((new ReflectionProperty(Foo::class, 'bar'))->getValue(new Foo));
var_dump((new ReflectionMethod(Foo::class, 'taz'))->invoke(new Foo));