Tag: iterators


  • GlobIterator exists since PHP5.3, and basically allows to iterator over anything glob()able. So instead of having to write my own custom FilterIterator and pass the DirectoryIterator for my directory to that FilterIterator, I can simple instantiate GlobIterator and pass the pattern that I need to it: $watchDir = new \GlobIterator($config[‘incomingPath’].’/*.xml’); Now I can foreach over…