1 2 3 4 5 6 7 8 9 10 11 12 13
<?php $a = 1; $b = 2; echo "we are here ".called_from(); function called_from(){ $trace = debug_backtrace(); $item = $trace[0]; return " ({$item['file']} line:{$item['line']})"; }
1
we are here (/t.php line:6)