PHP | ArrayObject getFlags() Function Last Updated : 27 Sep, 2019 Comments Improve Suggest changes Like Article Like Report The ArrayObject::getFlags() function is an inbuilt function in PHP which is used to get the behavior of flags of the ArrayObject. Syntax: int ArrayObject::getFlags( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the behavior flags of the ArrayObject. Below programs illustrate the ArrayObject::getFlags() function in PHP: Program 1: php <?php // PHP program to illustrate the // ArrayObject::getFlags() function // Declare an array and convert it into // array object $arrObject = new ArrayObject( array('Geeks', 'for', 'Geeks') ); // Use ArrayObject::getFlags() function // to get the behavior of flags $flag = $arrObject->getFlags(); var_dump($flag); // Set a new flags $arrObject->setFlags(ArrayObject::ARRAY_AS_PROPS); // Use ArrayObject::getFlags() function // to get the behavior of flags $flag = $arrObject->getFlags(); var_dump($flag); ?> Output: int(0) int(2) Program 2: php <?php // PHP program to illustrate the // ArrayObject::getFlags() function // Declare an associative array $arr = array( "a" => "Welcome", "b" => "to", "c" => "GeeksforGeeks" ); // Create array object $arrObject = new ArrayObject($arr); // Use ArrayObject::getFlags() function // to get the behavior of flags $flag = $arrObject->getFlags(); var_dump($flag); // Set a new flags $arrObject->setFlags(ArrayObject::STD_PROP_LIST); // Use ArrayObject::getFlags() function // to get the behavior of flags $flag = $arrObject->getFlags(); var_dump($flag); ?> Output: int(0) int(1) Reference: https://www.php.net/manual/en/arrayobject.getflags.php Comment More infoAdvertise with us Next Article PHP | ArrayObject getFlags() Function jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ArrayObject Similar Reads PHP ArrayObject setFlags() Function The ArrayObject::setFlags() function is an inbuilt function in PHP that is used to set the flag to change the behavior of the ArrayObject. Syntax: void ArrayObject::setFlags( int $flags ) Parameters: This function accepts single parameter $flags which hold the behavior of new ArrayObject. This param 2 min read PHP | ArrayIterator getFlags() Function The ArrayIterator::getFlags() function is an inbuilt function in PHP which is used to get the behavior of flags of array iterator. Syntax: int ArrayIterator::getFlags( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the behavior flags of the Array 1 min read ArrayObject getIterator() Function in PHP The getIterator() function of the ArrayObject class in PHP is used to create an iterator from an ArrayObject instance. This iterator can be used to iterate through the array of the respective ArrayObject. Syntax: ArrayIterator getIterator() Parameters: This function does not accepts any parameters. 1 min read ArrayObject offsetGet() Function in PHP The offsetGet() function of the ArrayObject class in PHP is used to get the value present at a specific index at the ArrayObject. Syntax: mixed offsetGet($index) Parameters: This function accepts a single parameter $index for which corresponding value will be returned. Return Value: This function re 1 min read ArrayObject getArrayCopy() Function in PHP The getArrayCopy() function of the ArrayObject class in PHP is used to create a copy of this ArrayObject. This function returns the copy of the array present in this ArrayObject. Syntax: array getArrayCopy() Parameters: This function does not accepts any parameters. Return Value: This function retur 1 min read ArrayObject offsetUnset() Function in PHP The offsetUnset() function of the ArrayObject class in PHP is used to unset the value preset at a specific index. In other words, it is used to remove a value present at a specific index in the ArrayObject. Syntax: void offsetUnset($index) Parameters: This function accepts a single parameter $index 2 min read ArrayObject offsetExists() Function in PHP The offsetExists() function of the ArrayObject class in PHP is used to whether a given offset or index is present in the ArrayObject or not. If it is present then the function returns a boolean True value otherwise it returns False. Syntax: bool offsetExists($index) Parameters: This function accepts 2 min read PHP | ArrayObject count() Function The ArrayObject::count() function is an inbuilt function in PHP which is used to get the number of public properties in the ArrayObject. Syntax: int ArrayObject::count( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the number of public propertie 1 min read ArrayObject asort() Function in PHP The asort() function of the ArrayObject class in PHP is used to sort all of the entries of the ArrayObject according to the values. The elements are arranged according to the values keeping the maintaining the association of the keys with the value. Syntax: void asort() Parameters: This function doe 1 min read Like