public static function collectionKeys($collection) { if (is_object($collection)) { return array_keys(get_object_vars($collection)); } else { return array_keys($collection); } }
/** * Evaluate an expression and return the last key * @return mixed */ public function lastKey() { $keys = AccessHelper::collectionKeys($this->data); if (empty($keys) || end($keys) === false) { return null; } return end($keys); }