25 protected $current = NULL;
26 protected $input = NULL;
31 function __construct (array $input, $size)
33 $this->input = array_values($input);
34 $this->n = count($this->input);
47 for ($i = 0; $i < $this->size; $i++) {
48 $r[] = $this->input[$this->current[$i]];
64 $this->current = range(0, $this->size);
70 return ($this->pos >= 0);
73 protected function _next ()
76 while (($i >= 0) && ($this->current[$i] == $this->n - $this->size + $i)) {
83 while ($i++ < $this->size - 1) {
84 $this->current[$i] = $this->current[$i - 1] + 1;