CakeFest 2024: The Official CakePHP Conference

SplFixedArray::count

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

SplFixedArray::countReturns the size of the array

Açıklama

public SplFixedArray::count(): int

Returns the size of the array.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns the size of the array.

Örnekler

Örnek 1 SplFixedArray::count() example

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

Yukarıdaki örneğin çıktısı:

5
5

Notlar

Bilginize:

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

Bilginize:

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

Ayrıca Bakınız

add a note

User Contributed Notes

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