A quick question that someone might be able to help me with. I am interested in finding out the name of the file and line number that is calling a function. For example I have this file
<?php
function testLine() {
echo "File: " . __FILE__ . "<br />\nLine: " . __LINE__;
}
testLine();// I want this line number
?>
When I call testLine it echos out the file and line #4 which is the expected behaviour. However, I want to find a way to find out the line number where it was called, which in this case would be 7. I know I can pass FILE & LINE to the function, I just would rather not have to pass that data every time. If anyone knows of a way I can do this I would be very grateful.
Thanks,
Bryan