<?php class foo { public $doSomething; public function __construct() { $this->doSomething = function ($a) { return $a*2; }; } } $object = new foo(); $array = [1,2,3,4]; print_r(array_map($object->doSomething, $array));
You have javascript disabled. You will not be able to edit any code.