array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'arrayobject.getflags.php', 1 => 'ArrayObject::getFlags', ), 'up' => array ( 0 => 'class.arrayobject.php', 1 => 'ArrayObject', ), 'prev' => array ( 0 => 'arrayobject.getarraycopy.php', 1 => 'ArrayObject::getArrayCopy', ), 'next' => array ( 0 => 'arrayobject.getiterator.php', 1 => 'ArrayObject::getIterator', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/arrayobject/getflags.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
ArrayObject::getFlags — Gets the behavior flags
Gets the behavior flags of the ArrayObject. See the ArrayObject::setFlags method for a list of the available flags.
This function has no parameters.
Returns the behavior flags of the ArrayObject.
Example #1 ArrayObject::getFlags() example
<?php
// Array of available fruits
$fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10);
$fruitsArrayObject = new ArrayObject($fruits);
// Get the current flags
$flags = $fruitsArrayObject->getFlags();
var_dump($flags);
// Set new flags
$fruitsArrayObject->setFlags(ArrayObject::ARRAY_AS_PROPS);
// Get the new flags
$flags = $fruitsArrayObject->getFlags();
var_dump($flags);
?>
The above example will output:
int(0) int(2)