Пример #1
0
 static function __static()
 {
     self::$iterate = newinstance('Iterator', array(), '{
     private $i= 0, $v, $b;
     public function on($v) { $self= new self(); $self->v= $v; return $self; }
     public function current() { return new Pair($this->b[0], $this->b[1]); }
     public function key() { return $this->i; }
     public function next() { $this->b= next($this->v); $this->i++; }
     public function rewind() { reset($this->v); $this->b= current($this->v); $this->i= 0;  }
     public function valid() { return $this->b !== FALSE; }
   }');
 }