Utils: fixed currentTrace() when xdebug is loaded, but not in develop mode

this is really dumb... why does it register the functions at all if they aren't usable ???
This commit is contained in:
Dylan K. Taylor 2022-08-25 16:56:26 +01:00
parent bd13f39156
commit 1ffd38b37b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -486,8 +486,8 @@ final class Utils{
*/
public static function currentTrace(int $skipFrames = 0) : array{
++$skipFrames; //omit this frame from trace, in addition to other skipped frames
if(function_exists("xdebug_get_function_stack")){
$trace = array_reverse(xdebug_get_function_stack());
if(function_exists("xdebug_get_function_stack") && count($trace = @xdebug_get_function_stack()) !== 0){
$trace = array_reverse($trace);
}else{
$e = new \Exception();
$trace = $e->getTrace();