- var_dump: documentation ( source)
<?php
class Foo implements Iterator {
protected $count = 500;
public function next() {
$this->count--;
}
public function valid() {
return $this->count > 0;
}
public function rewind() {
$this->count = 500;
}
public function key() {
return null;
}
public function current() {
return $this->count;
}
}
// This one
$f = new Foo;
foreach($f as $val) {
}
var_dump($f);