Say I have MyClass.php
class MyClass
{
public static function myMethod()
{
// Here I want to know the line (and file) where my method has been called
}
}
And SomeOtherFile.php
// other code ...
MyClass::myMethod();
// other code ...
So, is there a way to get the line from SomeOtherFile, where myMethod() has been called directly in myMethod? I mean, without passing the line as parameter.