ArrayObject::getFlags

(PHP 5 >= 5.1.0, PHP 7)

ArrayObject::getFlagsGets the behavior flags.

설명

public int ArrayObject::getFlags ( void )

Gets the behavior flags of the ArrayObject. See the ArrayObject::setFlags method for a list of the available flags.

인수

이 함수는 인수가 없습니다.

반환값

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);
?>

위 예제의 출력:

int(0)
int(2)

참고

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top