I'm designing a simple exception handler to use in my PHP projects. One of the things that always bugged me is the poor stack trace which truncates arguments etc. So I decided to use the getTrace()
-method to parse the array in a more usable string.
Doing so works fine, but I noticed that static method calls are not represented correctly:
getTrace()
:
#3 /system/session.php(38): Session->__construct()
#2 /system/session.php(126): Session->instance()
getTraceAsString()
:
#1 /system/session.php(38): Session->__construct()
#2 /system/session.php(126): Session::instance()
...where Session
might look like so:
class Session(){
public static function instance(){}
public function __construct(){}
}
Seems like the scope resolution operator (::
) is replaced by the object operator (->
) no matter what by getTrace()
.
Why is that so? Can I do something about it, is there a parameter I'm lacking?