Описание тега arrayobject
ArrayObject class allows objects to work as arrays in PHP. Properties of the object have their normal functionality when accessed as list. Use this tag for questions related to arrayobject.
ArrayObject class allows objects to work as arrays in PHP. Properties of the object have their normal functionality when accessed as list. Use this tag for questions related to arrayobject.
ArrayObject is an object that is designed to behave exactly like an array. If that seems confusing, don’t worry, it’s not. ArrayObject is an object. It follows all the rules of how objects work. But it’s designed to implicitly behave like an array for all intents and purposes, including being used in a foreach loop, and accessing its properties just like you would access the values in an array. Consider the following code sample:
<?php
$array = array('one', 'two', 'three');
$arrayObj = new ArrayObject($array);
var_dump(($array[0] == $arrayObj[0])); // Outputs true.
?>
For information on object and array please check object and array