- array_map: documentation ( source)
- var_dump: documentation ( source)
<?php
class Foo
{
private function mapIt($x) { return $x + 1; }
public function doStuff()
{
$xs = array_map(array($this, 'mapIt'), array(1, 2, 3));
var_dump($xs);
}
}
$x = new Foo();
$x->doStuff();