PHP Classes

File: arrayIterator.php

Recommend this page to a friend!
  Classes of Till Wehowski   $Event.$Iterator   arrayIterator.php   Download  
File: arrayIterator.php
Role: Class source
Content type: text/plain
Description: arrayIterator
Class: $Event.$Iterator
Register event handlers similar to JavaScript
Author: By
Last change:
Date: 8 years ago
Size: 461 bytes
 

Contents

Class file image Download
<?php
namespace frdl\Flow;


class
arrayIterator implements \Iterator {
  private
$a;

  public function
__construct( $theArray ) {
   
$this->a = $theArray;
  }
  function
rewind() {
    return
reset($this->a);
  }
  function
current() {
    return
current($this->a);
  }
  function
key() {
    return
key($this->a);
  }
  function
next() {
    return
next($this->a);
  }
  function
valid() {
    return
key($this->a) !== null;
  }
}