- printf: documentation ( source)
<?php
class It extends ArrayIterator {
public function __call($method, $args) {
printf("%s\n", $method);
return $this->$method();
}
}
$i = new It(array(1, 2, 3, 4));
foreach($i as $k => $v) {
printf("value: %d\n", $v);
}