Types - common types for PHP

Laurent Bedubourg


Table of Contents
Reference helper
Introduction
Ref class
Creating a reference
Accessing the source object
function ref
function is_ref
Iterator interface
Introduction
Iterable
Usages
Implementing an iterator
variables
constructor
method reset
method isValid
method next
method value
method index
method key (optional)
method remove (optional/dangerous)
Implementation example
Removable iterators
OString class
introduction
List of Examples
1. MyArrayIterator example
2. MyArrayIterator improved