public function __construct(array $keys, array $values) { $this->keys = $keys; $this->values = $values; foreach ($this->keys as $i => $k) { $this->keyToIndexMap[$k] = $i; } }