public static function getFirstElement(array $array, $firstLevelOnly = true)
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return null;
        }

        $firstKey = self::getFirstKey($array);
        $first = $array[$firstKey];

        if (!$firstLevelOnly && is_array($first)) {
            $first = self::getFirstElement($first, $firstLevelOnly);
        }

        return $first;
    }