[ create a new paste ] login | about

Link: http://codepad.org/CGUXWgAB    [ raw code | output | fork ]

PHP, pasted on Apr 8:
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']})";
}


Output:
1
we are here  (/t.php line:6)


Create a new paste based on this one


Comments: