Determine the "offending" file and line number when error occurs
===

This is a bit hard to explain but the code might be clearer:

    // class.php
    class Foo
    {
    	public function bar ()
    	{
    		
    	}
    }
    
    
    // test.php
    $foo = new Foo;
    $foo->bar(); // e.g., for some reason this returns an error hence error handler will be triggered

This is a simplified example but the nesting of test.php could be deeper.
How can my custom error handler tell me that the error occurred in test.php line 2?

I am currently using `debug_backtrace()` but the array index of test.php is varying depending on how deep the object is or how many `require()`'s

Is there a way to pinpoint this regardless of how deep the nesting of the function call is?