I think the better way is to do something in the foreach loop.

```
foreach ($arguments as $key => $value) {
  ...
}
```