function name($param, $line = __LINE__, $file = __FILE__) {};

后端 未结 4 2031
名媛妹妹
名媛妹妹 2020-12-19 08:30

Is it possible to have a function automatically contain the line number and the file that the function was CALLED in,

as if i call __LINE__ or __F

4条回答
  •  悲哀的现实
    2020-12-19 09:00

    The only way would be using debug_backtrace(), but as the name says: it is for debugging. Your code should not attach any meaning or functionality in production based on where/when it's called.

提交回复
热议问题