VOOZH about

URL: https://www.geeksforgeeks.org/php/php-arrayobject-setflags-function/

⇱ PHP ArrayObject setFlags() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

PHP ArrayObject setFlags() Function

Last Updated : 3 Apr, 2023

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 parameter holds either a bitmask or named constants. 

Return Value: This function does not return any value. 

Below examples illustrate the ArrayObject::setFlags() function in PHP: 

Example 1: 

Output:
int(0)
int(2)

Example 2: 

Output:
int(0)
int(1)

Reference: https://www.php.net/manual/en/arrayobject.setflags.php

Comment