- var_dump: documentation ( source)
- str_rot13: documentation ( source)
<?php
class Example implements Iterator
{
public $i = 0;
public $prop = 'pie';
public function rewind() { $this->i = 0;}
public function next() {}
public function valid() { return ($this->i++ < 5); }
public function key() { return 7; }
public function current() { return $this->prop; }
}
$it = new Example;
foreach ($it as &$current) {
$current = str_rot13($current);
}
var_dump($it);