src/SellerLabs/Nucleus/Support/Std.php
public static function each(callable $function, $input)
    {
        if ($input instanceof FoldableInterface) {
            $input->foldl(function ($acc, $x) use ($function) {
                $function($x);
            }, null);

            return;
        } elseif ($input instanceof LeftFoldableInterface) {
            $input->foldl(function ($x) use ($function) {
                $function($x);
            }, null);

            return;
        }

        static::map($function, $input);
    }
public static function each(callable $function, $input)
    {
        if ($input instanceof FoldableInterface) {
            $input->foldl(function ($acc, $x) use ($function) {
                $function($x);
            }, null);

            return;
        } elseif ($input instanceof LeftFoldableInterface) {
            $input->foldl(function ($x) use ($function) {
                $function($x);
            }, null);

            return;
        }

        static::map($function, $input);
    }
public static function each ( callable $ function , $ input ) { if ( $ input instanceof FoldableInterface ) { $ input -> foldl ( function ( $ acc , $ x ) use ( $ function ) { $ function ( $ x ) ; } , null ) ; return ; } elseif ( $ input instanceof LeftFoldableInterface ) { $ input -> foldl ( function ( $ x ) use ( $ function ) { $ function ( $ x ) ; } , null ) ; return ; } static :: map ( $ function , $ input ) ; }
Call the provided function on each element.

@param callable $function
@param array|Traversable|FoldableInterface|LeftFoldableInterface $input

@throws InvalidArgumentException
Call the provided function on each element .