(Available since version 1.0)
DynamicArray::getAllocatedSize — Gets the size of the internal array
Gets the size that is currently allocated for use by the array.
This function has no parameters.
Returns the size of the internal array, as an integer.
Example #1 DynamicArray::getAllocatedSize() example
<?php
require 'vendor/autoload.php'; // A PSR-4 or PSR-0 autoloader
use \SEIDS\Arrays\Dynamic\DynamicArray;
$array = new DynamicArray(5);
echo $array->getSize()."\n";
echo $array->getAllocatedSize()."\n";
$array->push(null);
echo $array->getSize()."\n";
echo $array->getAllocatedSize()."\n";
?>
The above example will output:
5 5 6 10