Is it possible to get information (filename, line, function ...) of the calling function by using late static binding?
<?php
class Log{
public static function write($msg){
$line = ??;
$msg = date('Y-m-d H:i:s').' '.$line.' '.$msg;
}
}
Log::write("wuhuu!"); // write new log entry including >>this<< line/filename/..
?>
In former times I used debug_backtrace()
or new \Exception
+ getTrace()
. Would it be possible (or easier) to use some great super-special late static binding feature-keywords/functions?