protected function firstIndex(array $arr) { $objs = array_keys($arr); rsort($objs); $first = null; foreach ($objs as $value) { $first = $value; } return $first; }