title: PHP How to get a method name with a class and namespace path as a string?
body: <p>I really hate to write this question because I'm kind-of "research guy" and, well, I always find what I'm searching for... But this one bugs me a lot and I can't find the answer anywhere... So, here it goes:</p>
  
  <p>As the title says I need to get a method name with the trailing class and namespace path as a string. I mean something like this: <code>"System\Language\Text::loadLanguageCache"</code>.
  As we know, you can get a class name (with full namespace path) by typing, i.e.: <code>Text::class</code> and it returns <code>"System\Language\Text"</code>, but is there a way to get this for a method? Something like: <code>Text::loadLanguageCache::function</code> to get string: <code>"System\Language\Text::loadLanguageCache"</code>?</p>
  
  <p>Edit:</p>
  
  <p>I think I should explain this further... I know about magic constant <code>__METHOD__</code> but the problem is that it works <em>inside the called method</em> and I need this <em>"outside the method"</em>.
  Take this as example:</p>
  
  <pre><code>//in System\Helpers
  function someFunction()
  { return __METHOD__; }
  </code></pre>
  
  <p>That's all OK with this if I call the function I'll get (let's assume that method is in <code>System\Helpers</code> class) - <code>"System\Helpers::someFunction"</code>. But what I want is this:</p>
  
  <pre><code>//in System\Helpers
  function someFunction()
  { //some code... whatever }
  
  // somewhere not in System\Helpers
  function otherFunction()
  {
      $thatFunctionName = Helpers::someFunction::method //That imaginary thing I want
  
      $thatClassName = Helpers::class; //this returns "System\Helpers"
  }
  </code></pre>
  
  <p>I hope this cleared my question a bit :)</p>