Gets the current character we are at.

@param int $char
@return string
353816
public function char($char = null)
    {
        $pos = $this->pos;
        if ( ! is_null($char)) {
            $pos = $char;
        }

        if ( ! isset($this->content[$pos])) {
            return '';
        }

        return $this->content[$pos];
    }
893841
public static function isLetterOrDigit($char)
    {
        $pattern = self::getLetterOrDigitPattern();

        return is_scalar($char) && (bool)preg_match($pattern, $char);
    }
961952
private static function getExtendedVersion($char) {
        $o = ord($char);
        if ($o === 0) {
            return '%U';
        } elseif ($o >= 1 && $o <= 26) {
            return '$' . chr($o + 64);
        } elseif (($o >= 33 && $o <= 44) || $o === 47 || $o === 48) {
            return '/' . chr($o + 32);
        } elseif ($o >= 97 && $o <= 122) {
            return '+' . chr($o - 32);
        } elseif ($o >= 27 && $o <= 31) {
            return '%' . chr($o + 38);
        } elseif ($o >= 59 && $o <= 63) {
            return '%' . chr($o + 11);
        } elseif ($o >= 91 && $o <= 95) {
            return '%' . chr($o - 16);
        } elseif ($o >= 123 && $o <= 127) {
            return '%' . chr($o - 43);
        } elseif ($o === 64) {
            return '%V';
        } elseif ($o === 96) {
            return '%W';
        } elseif ($o > 127) {
            return false;
        } else {
            return $char;
        }
    }
696091
private int _current() {
        if (buf != null) {
            return UTF16.charAt(buf, 0, buf.length, bufPos);
        } else {
            int i = pos.getIndex();
            return (i < text.length()) ? UTF16.charAt(text, i) : DONE;
        }
    }
265394
public function escapeCharacterClass($char)
	{
		return (isset($this->inCharacterClass[$char])) ? $this->inCharacterClass[$char] : $char;
	}
1236178
public static function isUpperCase($char): bool
    {
        self::handleIncomingChar($char);

        return static::compare($char, static::toUpperCase($char)) === 0;
    }
344428
public static function toUnicodeCodepoint($char)
    {
        $charCode = false;
        // 7bits, 1 char
        if ((ord($char[0]) & 0x80) == 0x00) {
            $charCode = ord($char[0]);
        } elseif ((ord($char[0]) & 0xe0) == 0xc0) { // 11 bits, 2 chars
            if ((ord($char[1]) & 0xc0) != 0x80) {
                return $charCode;
            }

            $charCode = (
                ((ord($char[0]) & 0x1f) << 6) +
                ((ord($char[1]) & 0x3f))
            );

            if ($charCode < 128) {
                throw new RuntimeException('Illegal UTF-8 input character: ' . $char);
            }
        } elseif ((ord($char[0]) & 0xf0) == 0xe0) { // 16 bits, 3 chars
            if ((ord($char[1]) & 0xc0) != 0x80 ||
                 (ord($char[2]) & 0xc0) != 0x80) {
                return $charCode;
            }
            $charCode = (
                ((ord($char[0]) & 0x0f) << 12) +
                ((ord($char[1]) & 0x3f) << 6) +
                ((ord($char[2]) & 0x3f))
            );

            if ($charCode < 2048) {
                throw new RuntimeException('Illegal UTF-8 input character: ' . $char);
            }
        } elseif ((ord($char[0]) & 0xf8) == 0xf0) { // 21 bits, 4 chars
            if ((ord($char[1]) & 0xc0) != 0x80 ||
                 (ord($char[2]) & 0xc0) != 0x80 ||
                 (ord($char[3]) & 0xc0) != 0x80) {
                return $charCode;
            }

            $charCode = (
                ((ord($char[0]) & 0x07) << 18) +
                ((ord($char[1]) & 0x3f) << 12) +
                ((ord($char[2]) & 0x3f) << 6) +
                ((ord($char[3]) & 0x3f))
            );

            if ($charCode < 65536) {
                throw new RuntimeException('Illegal UTF-8 input character: ' . $char);
            }
        } elseif ((ord($char[0]) & 0xfc) == 0xf8) { // 26 bits, 5 chars
            if ((ord($char[1]) & 0xc0) != 0x80 ||
                 (ord($char[2]) & 0xc0) != 0x80 ||
                 (ord($char[3]) & 0xc0) != 0x80 ||
                 (ord($char[4]) & 0xc0) != 0x80) {
                return $charCode;
            }

            $charCode = (
                ((ord($char[0]) & 0x03) << 24) +
                ((ord($char[1]) & 0x3f) << 18) +
                ((ord($char[2]) & 0x3f) << 12) +
                ((ord($char[3]) & 0x3f) << 6) +
                ((ord($char[4]) & 0x3f))
            );

            if ($charCode < 2097152) {
                throw new RuntimeException('Illegal UTF-8 input character: ' . $char);
            }
        } elseif ((ord($char[0]) & 0xfe) == 0xfc) { // 31 bits, 6 chars
            if ((ord($char[1]) & 0xc0) != 0x80 ||
                 (ord($char[2]) & 0xc0) != 0x80 ||
                 (ord($char[3]) & 0xc0) != 0x80 ||
                 (ord($char[4]) & 0xc0) != 0x80 ||
                 (ord($char[5]) & 0xc0) != 0x80) {
                return $charCode;
            }

            $charCode = (
                ((ord($char[0]) & 0x01) << 30) +
                ((ord($char[1]) & 0x3f) << 24) +
                ((ord($char[2]) & 0x3f) << 18) +
                ((ord($char[3]) & 0x3f) << 12) +
                ((ord($char[4]) & 0x3f) << 6) +
                ((ord($char[5]) & 0x3f))
            );

            if ($charCode < 67108864) {
                throw new RuntimeException('Illegal UTF-8 input character: ' . $char);
            }
        }

        return $charCode;
    }
1135072
public static function ord(string $char): int
    {
        if (\function_exists('\mb_ord')) {
            return \mb_ord($char);
        }

        $code = ($c = \unpack('C*', \substr($char, 0, 4))) ? $c[1] : 0;
        if (0xF0 <= $code) {
            return (($code - 0xF0) << 18) + (($c[2] - 0x80) << 12) + (($c[3] - 0x80) << 6) + $c[4] - 0x80;
        }
        if (0xE0 <= $code) {
            return (($code - 0xE0) << 12) + (($c[2] - 0x80) << 6) + $c[3] - 0x80;
        }
        if (0xC0 <= $code) {
            return (($code - 0xC0) << 6) + $c[2] - 0x80;
        }

        return $code;
    }
345077
public function char()
    {
        $str = '';

        foreach (func_get_args() as $char) {
            if (is_int($char)) {
                $str .= chr($char);
            }
        }

        return $str;
    }
22751
protected function output($char)
    {
        $output = $this->getOutput();
        $output .= $char;
        $this->setOutput($output);
    }
900128
public function char($column, $length = null)
    {
        $length = $length ?: Builder::$defaultStringLength;

        return $this->addColumn('char', $column, compact('length'));
    }
908254
public function translateChar($char, $use_default = true)
    {
        $dec = hexdec(bin2hex($char));

        if (array_key_exists($dec, $this->table)) {
            $char = $this->table[$dec];
        } else {
            $char = ($use_default ? self::MISSING : $char);
        }

        return $char;
    }
713670
public function setDefaultCrossingChar(string $char): self
    {
        return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char);
    }
622139
public static function randomChar( $char )
	{
		if ( strlen( $char ) == 0 )
			return '';

		$char = ord( $char );

		if ( $char > 64 && $char < 91 ) // Uppercase
			return static::randomCharRange( 65, 90 );

		if ( $char > 96 && $char < 123 ) // Lowercase
			return static::randomCharRange( 97, 122 );

		if ( $char > 47 && $char < 58 ) // Numeric
			return static::randomCharRange( 48, 57 );

		return static::$randomCharMap[random_int( 0, count( static::$randomCharMap ) )];
	}
1000962
public static function ord($char, &$bytes = null)
    {
        // Get the first byte from char
        $firstByte = substr($char, 0, 1);
        $firstByteCode = ord($firstByte);

        $bytes = 0;

        while ($firstByteCode >> 7 & 0x01) {
            $bytes++;
            $firstByteCode <<= 1;
        }

        if ($bytes === 0) {
            // 0b0xxxxxxx
            return ord($firstByte);
        }

        // Create a unicode ord
        $unicodeOrd = ((ord($firstByte) << ($bytes + 1)) & 0xFF) >> ($bytes + 1);

        for ($i = 1; $i < $bytes; $i++) {
            // Shift unicode byte to left on 6 position (0b10xxxxxx)
            $unicodeOrd <<= 6;
            $byte = ord(substr($char, $i, 1)) & 0b00111111;
            $unicodeOrd |= $byte;
        }

        return $unicodeOrd;
    }
860862
public static function getByteFromChar($char, $signed = false)
    {
        $byte = ord($char);
        if ($signed) {
            if ($byte > 128) {
                $byte = $byte - 256;
            }
        }
        return $byte;
    }
1019659
public static function valueOf($char): self
    {
        if (\is_string($char) || $char instanceof self) {
            return new static((string) $char);
        }

        throw new InvalidArgumentException('Unsupported character type!');
    }