La clase ArrayObject

(PHP 5, PHP 7)

Introducción

Esta clase permite a los objetos funcionar como arrays.

Sinopsis de la Clase

ArrayObject implements IteratorAggregate , ArrayAccess , Serializable , Countable {
/* Constantes */
const integer STD_PROP_LIST = 1 ;
const integer ARRAY_AS_PROPS = 2 ;
/* Métodos */
public __construct ( mixed $input = array() , int $flags = 0 , string $iterator_class = "ArrayIterator" )
public append ( mixed $value ) : void
public asort ( ) : void
public count ( ) : int
public exchangeArray ( mixed $input ) : array
public getArrayCopy ( ) : array
public getFlags ( ) : int
public getIteratorClass ( ) : string
public ksort ( ) : void
public natcasesort ( ) : void
public natsort ( ) : void
public offsetExists ( mixed $index ) : bool
public offsetGet ( mixed $index ) : mixed
public offsetSet ( mixed $index , mixed $newval ) : void
public offsetUnset ( mixed $index ) : void
public serialize ( ) : string
public setFlags ( int $flags ) : void
public setIteratorClass ( string $iterator_class ) : void
public uasort ( callable $cmp_function ) : void
public uksort ( callable $cmp_function ) : void
public unserialize ( string $serialized ) : void
}

Constantes predefinidas

Banderas de ArrayObject

ArrayObject::STD_PROP_LIST

Las propiedades del objeto tienen un comportamiento normal cuando se acceden como listado (var_dump, foreach, etc.).

ArrayObject::ARRAY_AS_PROPS

Se puede acceder a las entradas como propiedades (lectura y escritura).

Historial de cambios

Versión Descripción
5.3.0 Se implementó Serializable.

Tabla de contenidos