<?php
trait Foo {
public $property;
}
class Bar {
use Foo;
public $anotherProperty;
}
foreach ((new ReflectionClass(Bar::class))->getProperties() as $property) {
var_dump($property->name);
}
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/2vXBr on line 12
Process exited with code 255.