Php/docs/class.arrayobject

提供:Dev Guides
< Php
移動先:案内検索

(PHP 5, PHP 7)

はじめに

このクラスは、オブジェクトを配列として動作させます。


クラス概要


ArrayObject implements IteratorAggregate , ArrayAccess , Serializable , Countable {

/* 定数 */

const int STD_PROP_LIST = 1

const int ARRAY_AS_PROPS = 2

/* メソッド */

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 getIterator ( ) : ArrayIterator

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

}

定義済み定数

ArrayObject の定数

ArrayObject::STD_PROP_LIST
オブジェクトのプロパティは (var_dump, foreachなどで) 配列としてアクセスしたときと同じ機能を持ちます
ArrayObject::ARRAY_AS_PROPS
オブジェクトのエントリはプロパティとしてアクセスできます(読み書き可)


変更履歴

バージョン 説明
5.3.0 Serializable を実装しました。


目次