php8.5
Home/ Manual/ reference / spl/ The ArrayObject class

The ArrayObject class

This class allows objects to work as arrays.

Intro

This class allows objects to work as arrays.

Note

Wrapping objects with this class is fundamentally flawed, and therefore its usage with objects is discouraged.

Class synopsis

class ArrayObject implements IteratorAggregate implements ArrayAccess implements Serializable implements Countable { }

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). The ArrayObject class uses its own logic to access properties, thus no warning or error is raised when trying to read or write dynamic properties.

Changelog

VersionDescription

Arrayobject

In this section

Source: reference/spl/arrayobject.xml · from the official PHP manual (php/doc-en)