php - Getting the filename of where a function was called from -


is possible (in efficient manor) retrieve filename (and line if possible) of previous command called function in (included) file?

for example:

foo.php

function foo() {     bar(); } 

bar.php

function bar() {     // stuff show when above executed:     // foo.php, line 2 (last bit if possible) } 

thats job debug_backtrace():

function test($param) {     echo "$param";     var_dump(debug_backtrace()); } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -