How can I get the file and line where the class was declared and / or required?
Use Reflections to find out where the class was declared:
$reflector = new ReflectionClass('Foobar'); echo $reflector->getFileName(); echo $reflector->getStartLine();
Use inclued to find out what was included.
inclued