SplFixedArray::count

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

SplFixedArray::countReturns the size of the array

Descrizione

public SplFixedArray::count(): int

Returns the size of the array.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

Returns the size of the array.

Esempi

Example #1 SplFixedArray::count() example

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

Il precedente esempio visualizzerĂ :

5
5

Note

Nota:

This method is functionally equivalent to SplFixedArray::getSize().

Nota:

The count of elements is always equal to the set size because all values are initially initialized with null.

Vedere anche:

add a note add a note

User Contributed Notes

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