Many times I have to deal with very large files of code and in order not to have to look for many things when I debug, it would be very good to know in which line an echo or error capture has been executed, for example.
I thought I saw this function years ago and I think it was typical of PHP, it was something like this:
.256 ....
.257 $linea = capturoEstaPosicion();
.258
.259 echo "la posición es $linea"; // la posición es 257
There is a predefined constant called
__LINE__
whose value is the number of the line where it is used: