src/QCheck/Generator.php
public static function elements()
    {
        $coll = self::getArgs(func_get_args());
        if (empty($coll)) {
            throw new \InvalidArgumentException();
        }
        return self::choose(0, count($coll) - 1)
            ->bindGen(function (RoseTree $rose) use ($coll) {
                return self::pureGen($rose->fmap(
                    function ($index) use ($coll) {
                        return $coll[$index];
                    }
                ));
            });
    }
public static function elements()
    {
        $coll = self::getArgs(func_get_args());
        if (empty($coll)) {
            throw new \InvalidArgumentException();
        }
        return self::choose(0, count($coll) - 1)
            ->bindGen(function (RoseTree $rose) use ($coll) {
                return self::pureGen($rose->fmap(
                    function ($index) use ($coll) {
                        return $coll[$index];
                    }
                ));
            });
    }
public static function elements ( ) { $ coll = self :: getArgs ( func_get_args ( ) ) ; if ( empty ( $ coll ) ) { throw new \ InvalidArgumentException ( ) ; } return self :: choose ( 0 , count ( $ coll ) - 1 ) -> bindGen ( function ( RoseTree $ rose ) use ( $ coll ) { return self :: pureGen ( $ rose -> fmap ( function ( $ index ) use ( $ coll ) { return $ coll [ $ index ] ; } ) ) ; } ) ; }
creates a generator that randomly chooses from the specified values

Accepts either a variadic number of args or a single array of values.

Example:
Gen::elements('foo', 'bar', 'baz')
Gen::elements(['foo', 'bar', 'baz'])

@return Generator
creates a generator that randomly chooses from the specified values