Compact Array

An array is compact if it only uses automated indices, starting with 0. This doesn’t really show in PHP code, though performances are better for some operations.

Such array’s status may be reached by using array_values() or array_keys() on the array.

This notion is not related to the compact() function.

<?php

$array = [1,2,3];

$notCompact = [1,2,3, 4=>4];

$compactAgain = array_values($notCompact);

?>

Documentation

Related : compact(), Simple Switch