public static function ord($char)
	{
		if (! ReflectionTypeHint::isValid()) return false;
		if (is_null($char)) return $char;

		static $cache = array();
		if (array_key_exists($char, $cache)) return $cache[$char]; #speed improve

		switch (strlen($char))
		{
			case 1 : return $cache[$char] = ord($char);
			case 2 : return $cache[$char] = (ord($char{1}) & 63) |
											((ord($char{0}) & 31) << 6);
			case 3 : return $cache[$char] = (ord($char{2}) & 63) |
											((ord($char{1}) & 63) << 6) |
											((ord($char{0}) & 15) << 12);
			case 4 : return $cache[$char] = (ord($char{3}) & 63) |
											((ord($char{2}) & 63) << 6) |
											((ord($char{1}) & 63) << 12) |
											((ord($char{0}) & 7)  << 18);
			default :
				trigger_error('Character 0x' . bin2hex($char) . ' is not UTF-8!', E_USER_WARNING);
				return false;
		}
	}
public static function ord($char)
	{
		if (! ReflectionTypeHint::isValid()) return false;
		if (is_null($char)) return $char;

		static $cache = array();
		if (array_key_exists($char, $cache)) return $cache[$char]; #speed improve

		switch (strlen($char))
		{
			case 1 : return $cache[$char] = ord($char);
			case 2 : return $cache[$char] = (ord($char{1}) & 63) |
											((ord($char{0}) & 31) << 6);
			case 3 : return $cache[$char] = (ord($char{2}) & 63) |
											((ord($char{1}) & 63) << 6) |
											((ord($char{0}) & 15) << 12);
			case 4 : return $cache[$char] = (ord($char{3}) & 63) |
											((ord($char{2}) & 63) << 6) |
											((ord($char{1}) & 63) << 12) |
											((ord($char{0}) & 7)  << 18);
			default :
				trigger_error('Character 0x' . bin2hex($char) . ' is not UTF-8!', E_USER_WARNING);
				return false;
		}
	}
public static function ord ( $ char ) { if ( ! ReflectionTypeHint :: isValid ( ) ) return false ; if ( is_null ( $ char ) ) return $ char ; static $ cache = array ( ) ; if ( array_key_exists ( $ char , $ cache ) ) return $ cache [ $ char ] ; #speed improve
 switch ( strlen ( $ char ) ) { case 1 : return $ cache [ $ char ] = ord ( $ char ) ; case 2 : return $ cache [ $ char ] = ( ord ( $ char { 1 } ) & 63 ) | ( ( ord ( $ char { 0 } ) & 31 ) << 6 ) ; case 3 : return $ cache [ $ char ] = ( ord ( $ char { 2 } ) & 63 ) | ( ( ord ( $ char { 1 } ) & 63 ) << 6 ) | ( ( ord ( $ char { 0 } ) & 15 ) << 12 ) ; case 4 : return $ cache [ $ char ] = ( ord ( $ char { 3 } ) & 63 ) | ( ( ord ( $ char { 2 } ) & 63 ) << 6 ) | ( ( ord ( $ char { 1 } ) & 63 ) << 12 ) | ( ( ord ( $ char { 0 } ) & 7 ) << 18 ) ; default : trigger_error ( 'Character 0x' . bin2hex ( $ char ) . ' is not UTF-8!' , E_USER_WARNING ) ; return false ; } }
Converts a UTF-8 character to a UNICODE codepoint

@param   string|null    $char  UTF-8 character
@return  int|bool|null         Unicode codepoint
Returns FALSE if $char broken (not UTF-8)
Converts a UTF - 8 character to a UNICODE codepoint