SplFixedArray::getSize

(PHP 5 >= 5.3.0, PHP 7)
Gets the size of the array
public int SplFixedArray::getSize ( void )

Gets the size of the array.

Returns:

Returns the size of the array, as an integer.

Notes:

This method is functionally equivalent to SplFixedArray::count()

Examples:
SplFixedArray::getSize() example
1
2
3
4
5
6
<?php
$array new SplFixedArray(5);
echo $array->getSize()."\n";
$array->setSize(10);
echo $array->getSize()."\n";
?>

The above example will output:

5
10
See also:

SplFixedArray::count() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.