(Available since version 1.0)
DynamicArray::count — Returns the size of the array
Returns the size of the array.
Note:
This method is functionally equivalent to DynamicArray::getSize().
Note:
The count of elements is always equal to the set size because all values are initially initialized with
NULL
.
This function has no parameters.
Returns the size of the array.
Example #1 DynamicArray::count() example
<?php
require 'vendor/autoload.php'; // A PSR-4 or PSR-0 autoloader
use \SEIDS\Arrays\Dynamic\DynamicArray;
$array = new DynamicArray(5);
echo $array->count() . "\n";
echo count($array) . "\n";
?>
The above example will output:
5 5