- var_dump: documentation ( source)
<?php
class A
{
private $test;
public function setTest($value)
{
$this->test = $value;
return $this;
}
public function getPrivatePropertyOfAnotherOject(A $obj)
{
return $obj->test;
}
}
$a = (new A())->setTest('x');
var_dump((new A())->getPrivatePropertyOfAnotherOject($a));