RecursiveIteratorIterator::setMaxDepth
PHP function
Edit on GitHub ✎
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
Set max depth
Description
RecursiveIteratorIterator::setMaxDepth(int $maxDepth = -1): void
Set the maximum allowed depth.
Func
Parameters
maxDepthThe maximum allowed depth.
-1is used for any depth.
Return Values
Void
Errors/Exceptions
Emits an Exception if maxDepth is less than -1.