Miscellaneous Classes and Interfaces
PHP Manual

The ArrayObject class

Introduction

This class allows objects to work as arrays.

Class synopsis

ArrayObject
/* Constants */
const integer STD_PROP_LIST = 1 ;
const integer ARRAY_AS_PROPS = 2 ;
/* Methods */
__construct ([ mixed $input [, int $flags [, string $iterator_class ]]] )
void append ( mixed $value )
void asort ( void )
int count ( void )
array exchangeArray ( mixed $input )
array getArrayCopy ( void )
int getFlags ( void )
ArrayIterator getIterator ( void )
public string getIteratorClass ( void )
void ksort ( void )
void natcasesort ( void )
void natsort ( void )
bool offsetExists ( mixed $index )
mixed offsetGet ( mixed $index )
void offsetSet ( mixed $index , mixed $newval )
void offsetUnset ( mixed $index )
public void serialize ( void )
void setFlags ( int $flags )
void setIteratorClass ( string $iterator_class )
void uasort ( callback $cmp_function )
void uksort ( callback $cmp_function )
public void unserialize ( string $serialized )
}

Predefined Constants

ArrayObject Flags

ArrayObject::STD_PROP_LIST

Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.).

ArrayObject::ARRAY_AS_PROPS

Entries can be accessed as properties (read and write).

Changelog

Version Description
5.3.0 Implements Serializable.

Table of Contents


Miscellaneous Classes and Interfaces
PHP Manual