- var_dump: documentation ( source)
<?php
trait TraitWithProperties
{
private $a = 'foo';
protected $b = 'bar';
public $c = 'baz';
private static $as = self::class;
protected static $bs = __TRAIT__;
public static $cs = __CLASS__;
}
class SimpleClassWithTrait
{
use TraitWithProperties;
}
$refClass = new ReflectionClass('TraitWithProperties');
var_dump($refClass->getStaticProperties());