May 2017
Intermediate to advanced
340 pages
8h 16m
English
As we are defining the array size at the beginning, we may require changing the size later on. In order to do that, we have to use the setSize() method of the SplFixedArray class. An example is shown as follows:
$items = 5; $array = new SplFixedArray($items); for ($i = 0; $i < $items; $i++) { $array[$i] = $i * 10; } $array->setSize(10); $array[7] = 100;
Read now
Unlock full access