I'd suggest to iterate over the keys only: ``array_keys($this->data[$key]) as $k``