The Sequence interface
(No version information available, might only be in Git)
简介
A Sequence describes the behaviour of values arranged in a single, linear dimension.
Some languages refer to this as a "List". It’s similar to an array that uses
incremental integer keys, with the exception of a few characteristics:
- Values will always be indexed as [0, 1, 2, …, size - 1].
- Only allowed to access values by index in the range [0, size - 1].
Use cases:
接口摘要
class Ds\Sequence
implements Ds\Collection, ArrayAccess {
abstract public allocate(
int $capacity
):
void
abstract public insert(
int $index
,
mixed ...$values
):
void
abstract public join(
string $glue
= ?):
string
abstract public rotate(
int $rotations
):
void
abstract public set(
int $index
,
mixed $value
):
void
abstract public sum():
int|float
}
目录
There are no user contributed notes for this page.
官方地址:https://www.php.net/manual/en/class.ds-sequence.php