index = $index; } public function validate(&$arr, $interchange) { if (empty($arr[$this->index])) { $this->error($this->index . ' must exist'); } } }