$maxItems =
$this->maxItems;
$maxString =
$this->maxString;
$minDepth =
$this->minDepth;
$currentDepth = 0; // Current tree depth
$currentDepthFinalIndex = 0; // Final $queue index for current tree depth
$minimumDepthReached = 0 ===
$minDepth; // Becomes true when minimum tree depth has been reached
$cookie =
(object) []; // Unique object used to detect hard references
$a = null; // Array cast for nested structures
$stub = null; // Stub capturing the main properties of an original item value
// or null if the original value is used directly
$arrayStub =
new Stub();
$arrayStub->type = Stub::TYPE_ARRAY;
$fromObjCast = false;
for ($i = 0;
$i <
$len; ++
$i) { // Detect when we move on to the next tree depth
if ($i >
$currentDepthFinalIndex) { ++
$currentDepth;
$currentDepthFinalIndex =
$len - 1;
if ($currentDepth >=
$minDepth) { $minimumDepthReached = true;
} }