summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2023-06-26 19:04:47 +0200
committerUrban Müller2023-06-26 19:04:47 +0200
commit85fc7f9d60f13bf00c322ceda40eed3f3e873e21 (patch)
tree7eb771b5f21d4aa3dc93bda03960a00f34e37ffa
parent27507d2b3de7577bcbc5ab3b10fbc73a72152231 (diff)
downloaditools-85fc7f9d60f13bf00c322ceda40eed3f3e873e21.tar.gz
itools-85fc7f9d60f13bf00c322ceda40eed3f3e873e21.tar.bz2
itools-85fc7f9d60f13bf00c322ceda40eed3f3e873e21.zip
guarantee array result on debug_backtrace, avoid doubling of long stack due to variable name collision
-rw-r--r--it_debug.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/it_debug.class b/it_debug.class
index 98f8484..d851ecc 100644
--- a/it_debug.class
+++ b/it_debug.class
@@ -77,7 +77,7 @@ static function debug_backtrace($p = []) {
if (--$p['levels'] == 0)
break;
}
- return $result;
+ return (array)$result;
}
/**
@@ -229,8 +229,8 @@ static function backtrace($p = array())
{
foreach ($frames as $frame)
if ($tracesize < 100000 && ($tracesize += strlen(print_r($frame, true))) < 100000) # save mem
- $frames[] = $frame;
- $result = $frames ? print_r($frames, true) . "\n" : null;
+ $outframes[] = $frame;
+ $result = $outframes ? print_r($outframes, true) . "\n" : null;
}
else if ($p['format'] == "medium")
{