If RecursiveRoleIteratorStrategy and GeneratorStrategy do exactly the same, you should add a check based on the PHP version, and use the most efficient one.