Copied!

Array collection

Provides a wrapper around a standard PHP array.

  • internal
  • phpstan-template T
  • phpstan-implements \IteratorAggregate<int, T>
  • phpstan-implements \ArrayAccess<int, T>
CloneableFinalInstantiableIterable
  • Implements
    ArrayAccess
    Countable
    IteratorAggregate
    Traversable
Methods
public __construct(array $elements = [])
 

Constructor

  • param array<int|string,mixed> $elements
  • phpstan-param array<int, T> $elements
public count() : int
 

Count elements of an object

  • return int The count as an integer.
public first()
 
  • return mixed|false
  • phpstan-return T|false
public getIterator() : ArrayIterator
 

Retrieve an external iterator

  • return \ArrayIterator<int,mixed>
  • phpstan-return \ArrayIterator<int, T>
  • attribute ReturnTypeWillChange
public last()
 
  • return mixed|false
  • phpstan-return T|false
public offsetExists( $offset) : bool
 

Whether an offset exists

  • phpstan-param int $offset
public offsetGet( $offset)
 

Offset to retrieve

  • phpstan-param int $offset
  • phpstan-return T|null
  • attribute ReturnTypeWillChange
public offsetSet( $offset, $value) : void
 

Offset to set

  • phpstan-param int|null $offset
  • phpstan-param T $value
  • attribute ReturnTypeWillChange
public offsetUnset( $offset) : void
 

Offset to unset

  • phpstan-param int $offset
  • attribute ReturnTypeWillChange
public slice(int $offset, ?int $length = NULL) : array
 

Returns a subset of the array

  • return array<int,mixed>
  • phpstan-return array<int, T>
public toArray() : array
 
  • return array<int,mixed>
  • phpstan-return array<int, T>
Properties
private array $elements
 
  • var array<int,mixed>
  • phpstan-var array<int, T>
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration