UtfString
class UtfString implements ArrayAccess, Stringable (View source)
Implementation for UTF-8 strings.
The subscript operator in PHP, when used with string will return a byte and not a character. Because in UTF-8 strings a character may occupy more than one byte, the subscript operator may return an invalid character.
Because the lexer relies on the subscript operator this class had to be implemented.
Implements array-like access for UTF-8 strings.
In this library, this class should be used to parse UTF-8 queries.
Properties
list<string> | $characters | The multi-byte characters. |
Methods
No description
Checks if the given offset exists.
Gets the character at given offset.
Sets the value of a character.
Unsets an index.
Returns the length in characters of the string.
Returns the contained string.
Details
__construct(string $str)
No description
bool
offsetExists(mixed $offset)
Checks if the given offset exists.
string
offsetGet(mixed $offset)
Gets the character at given offset.
void
offsetSet(mixed $offset, mixed $value)
Sets the value of a character.
void
offsetUnset(mixed $offset)
Unsets an index.
int
length()
Returns the length in characters of the string.
string
__toString()
Returns the contained string.