php—Traversable interface

伊谢尔伦
Release: 2016-11-22 11:05:56
Original
1243 people have browsed it

Introduction

An interface to detect whether a class can be traversed using foreach.

Basic abstract interface that cannot be implemented alone. Instead it must be implemented by the IteratorAggregate or Iterator interface.

Note:

Built-in classes that implement this interface can use foreach for traversal without implementing the IteratorAggregate or Iterator interface.

Note:

This is an internal engine interface that cannot be implemented in PHP scripts. The IteratorAggregate or Iterator interface can be used instead.

Interface summary

Traversable {

}

This interface does not have any methods, its role is only as the basic interface for all traversable classes.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template