PHP debug_backtrace in production code to get information about calling method?

后端 未结 7 1033
野趣味
野趣味 2020-11-29 05:43

Is there a compelling reason to not use debug_backtrace for the sole purpose of determining the calling method\'s class, name, and parameter list? Not for debugging purposes

7条回答
  •  误落风尘
    2020-11-29 06:21

    debug_backtrace is one of the PHP error handling functions. The manual encourages users to define their own error handling rules, as well as modify the way the errors can be logged. This allows you to change and enhance error reporting to suit your needs. This also implies that the performance hit from using these functions is negligible.

    I think what you're doing is just fine.

提交回复
热议问题