- var_dump: documentation ( source)
<?php
class Foo
{
protected $var = true;
}
class Bar extends Foo
{
public $var = 'abc';
}
$reflectionFoo = new ReflectionProperty('Foo', 'var');
$reflectionBar = new ReflectionProperty('Bar', 'var');
Reflection::export($reflectionFoo);
Reflection::export($reflectionBar);
$bar = new Bar();
var_dump($bar);
//$reflectionFoo->setAccessible(true);
$reflectionFoo->setValue($bar, '<NEW>');
var_dump($bar);