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 get the first row that matches some where queries, or create it if it doesn't exist (in Laravel's Eloquent)?

What are Template literals (Template strings) in JS?

How to order a Laravel hasMany relationship?

How to pick what array_intersect function to use in PHP?

How to split a string into an array, in JS

How to sort an array of dates and times?

Why should you update APP_URL from from http://localhost?

What is the difference between integration and unit tests?

How to get the last character of a string in JS?

How to redirect your website to a new domain/location in .htaccess