mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
476bd80644
commit
dca050fbd6
2 changed files with 16 additions and 1 deletions
|
@ -477,6 +477,16 @@ TEXT;
|
||||||
$this->assertEquals($expected, $output);
|
$this->assertEquals($expected, $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that exportVar() doesn't loop through recursive structures.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testExportVarRecursion() {
|
||||||
|
$output = Debugger::exportVar($GLOBALS);
|
||||||
|
$this->assertContains("'GLOBALS' => [recursion]", $output);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test trace exclude
|
* test trace exclude
|
||||||
*
|
*
|
||||||
|
|
|
@ -542,9 +542,14 @@ class Debugger {
|
||||||
|
|
||||||
if ($depth >= 0) {
|
if ($depth >= 0) {
|
||||||
foreach ($var as $key => $val) {
|
foreach ($var as $key => $val) {
|
||||||
|
if ($val !== $var) {
|
||||||
|
$val = self::_export($val, $depth, $indent);
|
||||||
|
} else {
|
||||||
|
$val = '[recursion]';
|
||||||
|
}
|
||||||
$vars[] = $break . self::exportVar($key) .
|
$vars[] = $break . self::exportVar($key) .
|
||||||
' => ' .
|
' => ' .
|
||||||
self::_export($val, $depth, $indent);
|
$val;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$vars[] = $break . '[maximum depth reached]';
|
$vars[] = $break . '[maximum depth reached]';
|
||||||
|
|
Loading…
Reference in a new issue