-
-
Notifications
You must be signed in to change notification settings - Fork 1
SplArrayObject
O2System PHP Framework edited this page Aug 31, 2017
·
7 revisions
This class is an extension class from ArrayObject, the purposes of this class is allows objects to work as arrays. The SplArrayObject class is use ArrayConversionTrait and ArrayFunctionsTrait to robust the class functionalities.
O2System\Spl\DatastructuresO2System\Spl\Datastructures\SplArrayObjectuse O2System\Spl\Datastructures\SplArrayObject;
$vehicles = new SplArrayObject();
$vehicles[ 'cars' ] = [ 'Ferrari', 'Porsche' ];O2System\Spl\Datastructures\SplArrayObject class constructor.
| Parameter | type | Requirement | Description |
|---|---|---|---|
$array |
array |
optional | initial array |
$flag |
int |
optional | ArrayObject Flags |
| Type | Description |
|---|---|
SplArrayObject |
Returns an SplArrayObject object on success. |
$vehicles = new SplArrayObject(
[
'cars' => [
'Ferrari',
'Porsche'
]
], SplArrayObject::ARRAY_AS_PROPS
);Checks if the array storage is empty.
| Type | Description |
|---|---|
bool |
Returns an TRUE on success and FALSE on failed. |
Copyright (c) 2016 Steeve Andrian Salim - O2System PHP Framework