I\'m using this recursive code to read all directories inside another directory, and store them within the parent directory.
protected function readDirs($parent)
It means that the property is a reference to an object that has already been visited by print_r
. print_r
detects this and doesn't continue down that path; otherwise, the resulting output would be infinitely long.
In the context of your program, as scandir
also returns references to the current and parent directories (named .
and ..
, respectively), following them would lead to recursion. Following symbolic links may also cause recursion.