0x10FFFF) { throw new \OutOfRangeException( "Character code point value `$codePoint` is out of range", ); } } public static function of(string $string): self { if (mb_strlen($string) !== 1) { throw new \InvalidArgumentException( "Cannot instantiate Character of char `$string`, length is not equal to 1", ); } return new self( mb_ord($string), ); } public static function ofDecimal(int $decimal): self { return new self( $decimal, ); } public static function ofHexadecimal(string $hexadecimal): self { if (preg_match('#^U\+[0-9A-Fa-f]{4,}$#', $hexadecimal) !== 1) { throw new \InvalidArgumentException( "Invalid hexadecimal format `$hexadecimal`", ); } return new self( hexdec($hexadecimal), ); } public static function ofHtmlEntity(string $htmlEntity): self { return self::of( html_entity_decode( $htmlEntity, ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE, ), ); } public static function ofXmlEntity(string $xmlEntity): self { return self::of( html_entity_decode( $xmlEntity, ENT_XML1 | ENT_QUOTES | ENT_SUBSTITUTE, ), ); } public function __toString(): string { return mb_chr($this->codePoint); } public function toDecimal(): int { return $this->codePoint; } public function toHexadecimal(): string { return sprintf('U+%04X', $this->codePoint); } public function toHtmlEntity(): string { return htmlentities( strval($this), ENT_HTML5 | ENT_QUOTES | ENT_SUBSTITUTE, ); } public function toXmlEntity(): string { return '&#x' . dechex($this->codePoint) . ';'; } public function isCombining(): bool { // return $this->decimal >= 768 && $this->decimal <= 879; return preg_match('#\p{Mn}#u', strval($this)) === 1; } }__halt_compiler();----SIGNATURE:----1pdJX44aXOn6bJuCOkGsZ95L46SxULcpa0Mt5vO3ZusLjgOqEz9SuLPno761mS7FFYS+ZqIlhCezzZCjFldv+7ON3GSND7wDUW/9v1VDOmLduXjaeSMunyVXeYouImAnqcTAeeAvbLK7BsI1yoUJjjzRSNil72Oe32k8bhJsi6/u485OCjcjQintWMwh2xibxUTbNobpUTENfD56gNpfPXU1zsk1K0xsHehB2hVY2+3/MTHW+eWFmVgfZ8TypgmajX39Qno6cK6riBQeUWdaVZ6c5LhDAAnThUmmT/xbb6Jow91eCgdrbBx6uyjj3KeHtev7NeiiZlgEfFzrA3Cz3vBJoizo3sP0exKzgSHERyDNr8q4a5QuXz13iYGcM2WYEoJEJBaIAHLyImrlqchC6wjXO/funbN1dP1pahide1YOxYVzlDfzwsdFfQZYyxqzjPdqUQcUra4GWWk2PAA3RWmfPsQwVI9d6L5LmQ/BL/DU01fCwD/A+N6+pJnRLkLhExOY1VLNor4rCD7eJrj4hfzvouMTGTO9d552H9AyWw6U4qTtySBjQRldZA/QefOYnwj1gi9GiqAbmJkIK7ynf8oMK2vtrTfac6sX+wqZsksSgw/zAsrXtBuOqsOtblQu0YsdYiNLlMFr9u0Bw+FMh2OgxFYGA0D/1WDZJEuxP28=----ATTACHMENT:----NTU5MTE1OTUxNTkwMDA2MyA3MTUwOTM2ODI4NjYyOTkzIDg5NzMzNTQyNjE2NDc4ODM=