Documentation

Str
in package
implements Stringable, IteratorAggregate, FromIterator, TryFromIterator

Immutable UTF-8 string wrapper.

Tags
psalm-immutable
implements

IteratorAggregate<int, string>

implements

TryFromIterator<Str>

implements

FromIterator<Str>

psalm-suppress

ImpureMethodCall, MixedArgumentTypeCoercion

Table of Contents

Interfaces

Stringable
IteratorAggregate
FromIterator
TryFromIterator

Properties

$str  : string

Methods

__toString()  : string
byteChars()  : Iter<int, string>
byteCount()  : int
bytes()  : Iter<int, int>
chars()  : Iter<int, string>
codepoints()  : Iter
fromChars()  : Str
fromIterator()  : Impl
getIterator()  : Traversable
length()  : int
of()  : Str
tryFromIterator()  : Result
unwrap()  : string
__construct()  : mixed

Properties

$str read-only

protected string $str

Methods

__toString()

public __toString() : string
Tags
inheritDoc
Return values
string

byteChars()

public byteChars() : Iter<int, string>
Return values
Iter<int, string>

byteCount()

public byteCount() : int
Return values
int

bytes()

public bytes() : Iter<int, int>
Return values
Iter<int, int>

chars()

public chars() : Iter<int, string>
Return values
Iter<int, string>

fromChars()

public static fromChars(iterable<string|int, string> $chars) : Str
Parameters
$chars : iterable<string|int, string>
Tags
psalm-suppress

InvalidArgument

Return values
Str

fromIterator()

public static fromIterator(Iterator $iterator) : Impl
Parameters
$iterator : Iterator
Return values
Impl

getIterator()

public getIterator() : Traversable
Tags
inheritDoc
Return values
Traversable

length()

public length() : int
Return values
int

of()

public static of(string $str) : Str
Parameters
$str : string
Return values
Str

tryFromIterator()

public static tryFromIterator(Iterator $iterator) : Result
Parameters
$iterator : Iterator
Tags
inheritDoc
Return values
Result

unwrap()

public unwrap() : string
Return values
string

__construct()

protected __construct(string $str) : mixed
Parameters
$str : string

        
On this page

Search results