SplFixedArray::count
(PHP 5 >= 5.3.0)
SplFixedArray::count — Returns the size of the array
Descrição
public int SplFixedArray::count
( void
)
Returns the size of the array.
Parâmetros
Esta função não possui parâmetros.
Valor Retornado
Returns the size of the array.
Exemplos
Example #1 SplFixedArray::count() example
<?php
$array = new SplFixedArray(5);
echo $array->count() . "\n";
echo count($array) . "\n";
?>
O exemplo acima irá imprimir:
5 5
Notas
Note:
This method is functionally equivalent to SplFixedArray::getSize().
Note:
The count of elements is always equal to the set size because all values are initially initialized with
NULL.
Veja Também
- SplFixedArray::getSize() - Gets the size of the array