<?php
trait MyTrait
{
/**
* Comes from trait
*/
private $foo;
}
class MyClass
{
use MyTrait;
/**
* Comes from class
*/
private $foo;
}
$classFoo = new \ReflectionProperty('MyClass', 'foo');
$traitFoo = new \ReflectionProperty('MyTrait', 'foo');
var_export($traitFoo->getDocComment() == $classFoo->getDocComment());
Strict Standards: MyClass and MyTrait define the same property ($foo) in the composition of MyClass. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /in/uJA3s on line 19
false