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

        $last = end($array);

        if (!$firstLevelOnly && is_array($last)) {
            $last = self::getLastElement($last, $firstLevelOnly);
        }

        return $last;
    }