Sometimes RecursiveIteratorIterator will get stuck in a loop and exhaust all of PHP