- var_dump: documentation ( source)
<?php
class Foo {
private function myPrivate() {
return true;
}
}
class Bar extends Foo {}
$obj = new Bar;
$reflMethod = new \ReflectionMethod($obj, 'myPrivate');
$reflMethod->setAccessible(true);
$return = $reflMethod->invoke($obj);
var_dump($return);