title: PHP Reflection: How to know if a method/property/constant is inherited from trait?
body: <p>I want to exclude all inherited methods from trait(s) from the list <strong>that are not overriden in a class</strong>
  So how to know if a class member is inherited from trait?</p>
  
  <p>Yes, I can check it like this:</p>
  
  <pre><code>    if ($trait-&gt;hasMethod($methodName)
          || $ref-&gt;getTraitAliases()[$methodName] !== null)
      {
          //
      }
  </code></pre>
  
  <p>But what if the trait method is overriden in a class? How to know it?
  One way is to check if method bodies are similar, if so, i may exclude it,
  but is there a better way to achieve this?</p>