What are the SPL Iterators in PHP?

PHP: What are the SPL Iterators in PHP?

The iterators in the Standard PHP Library (SPL) are the following:

AppendIterator — The AppendIterator class

ArrayIterator — The ArrayIterator class

CachingIterator — The CachingIterator class

CallbackFilterIterator — The CallbackFilterIterator class

DirectoryIterator — The DirectoryIterator class

EmptyIterator — The EmptyIterator class

FilesystemIterator — The FilesystemIterator class

FilterIterator — The FilterIterator class

GlobIterator — The GlobIterator class

InfiniteIterator — The InfiniteIterator class

IteratorIterator — The IteratorIterator class

LimitIterator — The LimitIterator class

MultipleIterator — The MultipleIterator class

NoRewindIterator — The NoRewindIterator class

ParentIterator — The ParentIterator class

RecursiveArrayIterator — The RecursiveArrayIterator class

RecursiveCachingIterator — The RecursiveCachingIterator class

RecursiveCallbackFilterIterator — The RecursiveCallbackFilterIterator class

RecursiveDirectoryIterator — The RecursiveDirectoryIterator class

RecursiveFilterIterator — The RecursiveFilterIterator class

RecursiveIteratorIterator — The RecursiveIteratorIterator class

RecursiveRegexIterator — The RecursiveRegexIterator class

RecursiveTreeIterator — The RecursiveTreeIterator class

RegexIterator — The RegexIterator class

webdevetc profile pic

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.


Comments and discussion about What are the SPL Iterators in PHP?

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the PHP language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

How to Force www or non-www in htaccess

What is the difference between ( for ... in ) and ( for ... of ) in javascript?

How to find an item by Primary Key in Eloquent, or throw a ModelNotFoundException exception if it isn't found?

How to check if a relation was loaded on an Eloquent model already?

What is the difference between integration and unit tests?

How to manually write your own pagination in PHP

How to block multiple IP addresses in .htaccess

How to set infinite execution time in a PHP script

How to run an artisan command from a controller

How to prevent Eloquent from adding created_at or updated_at timestamps?