SplFixedArray::count

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

SplFixedArray::countReturns the size of the array

Descrição

public SplFixedArray::count(): int

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

Exemplo #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

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.

Veja Também

add a note add a note

User Contributed Notes

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