- var_dump: documentation ( source)
<?php
class A {
public function foo(&$arg1) {
var_dump('arg1: ', $arg1);
}
}
class B extends A {
public function bar() {
$x = new stdClass();
$x->baz = 'just a value';
$this->callPrivate($x);
}
private function callPrivate($x)
{
$method = new \ReflectionMethod(
'A',
'foo'
);
//working 5.4 (* see above) but not in 5.5
$arguments = func_get_args();
return $method->invokeArgs($this, $arguments);
}
}
$obj = new B;
$obj->bar();