- var_dump: documentation ( source)
<?php
trait ProtectedTestTrait {
protected $test;
}
class ProtectedTestBase {
use ProtectedTestTrait;
}
class ProtectedTestChild extends ProtectedTestBase {
public function execute()
{
$this->test = 'blah';
}
}
$protectedChild = new ProtectedTestChild();
echo $protectedChild->execute();
var_dump($protectedChild);