public static function contains($container, $val): bool
    {
        if (\is_array($container)) {
            return \in_array($val, $container, true);
        }
        
        if ($container instanceof \Traversable) {
            foreach ($container as $tmp) {
                if ($tmp === $val) {
                    return true;
                }
            }
        }
        
        return false;
    }
public static function contains($container, $val): bool
    {
        if (\is_array($container)) {
            return \in_array($val, $container, true);
        }
        
        if ($container instanceof \Traversable) {
            foreach ($container as $tmp) {
                if ($tmp === $val) {
                    return true;
                }
            }
        }
        
        return false;
    }
public static function contains ( $ container , $ val ) : bool { if ( \ is_array ( $ container ) ) { return \ in_array ( $ val , $ container , true ) ; } if ( $ container instanceof \ Traversable ) { foreach ( $ container as $ tmp ) { if ( $ tmp === $ val ) { return true ; } } } return false ; }
Check if the given value is contained within the given container. Supported container
types are arrays and traversable objects.

@param mixed $container The container to be checked.
@param mixed $val The value to be checked for.
@return boolean Returns true if the container contains the given value.
Check if the given value is contained within the given container . Supported container types are arrays and traversable objects .