3 ms·
list($firstElement) = $this->method(); array_map(array($this, 'doSomething'), $array); Yes, neither is intuitive. And the syntax sucks. And it's not as e
by strager 15y ago
list($firstElement) = $this->method();
array_map(array($this, 'doSomething'), $array);
Yes, neither is intuitive. And the syntax sucks. And it's not as easy to read (except sometimes where a method returns a tuple; `list` is wonderful there!). But it's certainly possible...