public static function spinner()
    {
        static $spinner = 0;
        static $mtime = null;

        // static $chars = '-\|/';
        static $chars = '-.*.-';

        $now = microtime(true);
        if (null === $mtime || ($mtime < $now - 0.1)) {
            $mtime = $now;
            self::clearLine();
            echo $chars[$spinner];
            $spinner++;

            if ($spinner > strlen($chars) - 1) {
                $spinner = 0;
            }
        }
    }
public static function spinner()
    {
        static $spinner = 0;
        static $mtime = null;

        // static $chars = '-\|/';
        static $chars = '-.*.-';

        $now = microtime(true);
        if (null === $mtime || ($mtime < $now - 0.1)) {
            $mtime = $now;
            self::clearLine();
            echo $chars[$spinner];
            $spinner++;

            if ($spinner > strlen($chars) - 1) {
                $spinner = 0;
            }
        }
    }
public static function spinner ( ) { static $ spinner = 0 ; static $ mtime = null ; // static $chars = '-\|/'; static $ chars = '-.*.-' ; $ now = microtime ( true ) ; if ( null === $ mtime || ( $ mtime < $ now - 0.1 ) ) { $ mtime = $ now ; self :: clearLine ( ) ; echo $ chars [ $ spinner ] ; $ spinner ++ ; if ( $ spinner > strlen ( $ chars ) - 1 ) { $ spinner = 0 ; } } }
Spinner that updates every call up to 4 per second

.*.
Spinner that updates every call up to 4 per second