php8.5
Home/ Manual/ spl / splfixedarray/ SplFixedArray::getSize

SplFixedArray::getSize

PHP function Edit on GitHub ✎

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

Gets the size of the array

Description

SplFixedArray::getSize(): int

Gets the size of the array.

Parameters Parameters

Return Values

Returns the size of the array, as an int.

Examples

SplFixedArray::getSize example

php
<?php
$array = new SplFixedArray(5);
echo $array->getSize()."\n";
$array->setSize(10);
echo $array->getSize()."\n";
?>

The above example will output:

output
5
10

Notes

Note

This method is functionally equivalent to SplFixedArray::count

See Also

  • SplFixedArray::count

Source: reference/spl/splfixedarray/getsize.xml · from the official PHP manual (php/doc-en)