PHP | CachingIterator getFlags() Function Last Updated : 26 Nov, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The CachingIterator::getFlags() function is an inbuilt function in PHP which is used to get the bitmask of the flags used for this CachingIterator instance. Syntax: int CachingIterator::getFlags( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the flags used for this CachingIterator instance. Below programs illustrate the CachingIterator::getFlags() function in PHP: Program 1: php <?php // Declare an array $arr = array('G', 'e', 'e', 'k', 's'); // Create a new CachingIterator $cachIt = new CachingIterator( new ArrayIterator($arr), CachingIterator::FULL_CACHE ); // Get the flag $flag = $cachIt->getFlags(); // Display the flag var_dump($flag); ?> Output: int(256) Program 2: php <?php // Declare an ArrayIterator $arr = array( "a" => "Geeks", "b" => "for", "c" => "Geeks", "d" => "Computer", "e" => "Science", "f" => "Portal" ); // Create a new CachingIterator $cachIt = new CachingIterator( new ArrayIterator($arr), CachingIterator::FULL_CACHE ); // Get the flag $flag = $cachIt->getFlags(); // Display the flag value var_dump($flag); ?> Output: int(256) Reference: https://www.php.net/manual/en/cachingiterator.getflags.php Comment More infoAdvertise with us Next Article PHP | CachingIterator next() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Iterators Similar Reads PHP | CachingIterator getCache() Function The CachingIterator::getCache() function is an inbuilt function in PHP which is used to retrieve the contents of the cache. Syntax: array CachingIterator::getCache( void ) Parameters: This function does not accept any parameters. Return Value: This function returns an array containing the cache item 2 min read PHP | CachingIterator next() Function The CachingIterator::next() function is an inbuilt function in PHP which is used to move the iterator to the forward. Syntax: void CachingIterator::next( void ) Parameters: This function does not accept any parameters. Return Value: This function does not return any value. Below programs illustrate 1 min read PHP | CachingIterator key() Function The CachingIterator::key() function is an inbuilt function in PHP which is used to return the key for the current element. Syntax: scalar CachingIterator::key( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the key value of the current element. B 1 min read PHP | CachingIterator setFlags() Function The CachingIterator::setFlags() function is an inbuilt function in PHP which is used to set the flags for the CachingIterator object. Syntax: void CachingIterator::setFlags( int $flags ) Parameters: This function accepts a single parameter $flags which holds the value of bitmask of the flags to set. 1 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 PHP CachingIterator hasNext() Function The CachingIterator::hasNext() function is an inbuilt function in PHP that is used to iterate the next element in the iterator. CachingIterator class is to cache the elements of an underlying iterator to improve performance when iterating over the same data multiple times. Syntax: public CachingIter 2 min read Like