src/Collection.php
public function walk($callback, $userdata = null)
    {
        $elements = $this->items;
        \array_walk($elements, $callback, $userdata);

        return new static($elements);
    }
public function walk($callback, $userdata = null)
    {
        $elements = $this->items;
        \array_walk($elements, $callback, $userdata);

        return new static($elements);
    }
public function walk ( $ callback , $ userdata = null ) { $ elements = $ this -> items ; \ array_walk ( $ elements , $ callback , $ userdata ) ; return new static ( $ elements ) ; }
Applies the callback to all elements in the Collection, returning a new Collection

@link http://ca.php.net/array_walk

@param callable $callback Receives: (&$value, $key, ?$userdata)
@param mixed    $userdata (optional) additional user data for the callback

@return static
Applies the callback to all elements in the Collection returning a new Collection