SplFixedArray::count

(PHP 5 >= 5.3.0, PHP 7)

SplFixedArray::countReturns the size of the array

Descrierea

public SplFixedArray::count ( ) : int

Returns the size of the array.

Parametri

Această funcție nu are parametri.

Valorile întoarse

Returns the size of the array.

Exemple

Example #1 SplFixedArray::count() example

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

Exemplul de mai sus va afișa:

5
5

Note

Notă:

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

Notă:

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

A se vedea și

add a note add a note

User Contributed Notes

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