function get_code_line_caller($var) {
$trace = debug_backtrace();
$this_file_source_code = file( __FILE__ );
$the_line_code_that_call_to_this_function = $this_file_source_code[$trace[0]['line'] - 1];
return $the_line_code_that_call_to_this_function;
}
$num = 23452;
echo get_code_line_caller($num);
$str = "PHP";
echo get_code_line_caller($str);
$arr = array(1, 2, 3);
echo get_code_line_caller($arr);
/*
run:
echo get_code_line_caller($num);
echo get_code_line_caller($str);
echo get_code_line_caller($arr);
*/