Let\'s say I have two files, each one has a class. How can I get the filename where the child class is, within the parent class?
File 2 (child class):
Not really sure what purpose it serves, but here you go:
class A{ final protected function __construct(){ $obj = new ReflectionClass($this); $filename = $obj->getFileName(); } }