public function walk(callable $callback) : void
    {
        $newData = [];
        foreach($this->_data as $key => $value) {
            $ret = $callback($key, $value);

            $newData[$ret[0]] = $ret[1];
        }

        $this->_data = $newData;
    }
public function walk(callable $callback) : void
    {
        $newData = [];
        foreach($this->_data as $key => $value) {
            $ret = $callback($key, $value);

            $newData[$ret[0]] = $ret[1];
        }

        $this->_data = $newData;
    }
public function walk ( callable $ callback ) : void { $ newData = [ ] ; foreach ( $ this -> _data as $ key => $ value ) { $ ret = $ callback ( $ key , $ value ) ; $ newData [ $ ret [ 0 ] ] = $ ret [ 1 ] ; } $ this -> _data = $ newData ; }
Walks through the array.

The difference between this method and `map` is that
the callback must return an array with two indexes:

* The new key of the item.
* The new value of the item.

This will override the current array while `map` will only loop
through the array and call the callback with the item key and value.

Example:

```php
$arr = new \Alexya\Tools\Collection([
"test",
"foo",
"bar",
"tests"
]);

$arr->walk(function($key, $value) {
$value = strtoupper($value);

return [$key, $value];
});
// $arr = new \Alexya\Tools\Collection([
//     "TEST",
//     "FOO",
//     "BAR",
//     "TESTS"
// ]);
```

@param callable $callback Callback to apply to the array.
Walks through the array .