<?php class foo { var $var; function bar() { array_map(array($this, "baz"), array(1,2,3)); } function baz($arg) { $this->var = $this->var + $arg; } } ?> //https://www.php.net/manual/zh/function.array-map.php