/** * Checks if $key exists. * @param mixed key or index * @return bool */ public function offsetExists($key) { if (is_int($key)) { return (bool) current(array_slice((array) $this, $key, 1)); } return parent::offsetExists($key); }
public function offsetExists($key) { if (is_int($key)) { $arr = array_values((array) $this); return isset($arr[$key]); } return parent::offsetExists($key); }
private function value($key, \Nette\ArrayHash $arr) { return $arr->offsetExists($key) ? $arr->offsetGet($key) : ''; }