- var_export: documentation ( source)
<?php
class Foo {
protected static $bar = 'bar';
function test() {
echo 'Non-static access: ', var_export($this->bar, true), PHP_EOL;
echo 'Static access: ', var_export(self::$bar, true), PHP_EOL;
}
}
(new Foo)->test();