public static function getFirstNonEmptyElement($list, $default = null)
    {
        foreach ($list as $item) {
            if (empty($item) === false) {
                return $item;
            }
        }
        return $default;
    }
public static function getFirstNonEmptyElement($list, $default = null)
    {
        foreach ($list as $item) {
            if (empty($item) === false) {
                return $item;
            }
        }
        return $default;
    }
public static function getFirstNonEmptyElement ( $ list , $ default = null ) { foreach ( $ list as $ item ) { if ( empty ( $ item ) === false ) { return $ item ; } } return $ default ; }
Get the first non-empty element of a list.

@param array $list    The list to scan.
@param mixed $default If no non-empty element is found, return this value.

@return mixed The first non-empty element in the list.
Get the first non - empty element of a list .