An array declared with missing ("sparse") elements is likely to be an error: an extra comma was inserted or perhaps the developer meant to insert the missing value and forgot.
=== on 8 Nov 2017, 09:56:07 Michael Gumowski wrote:
Removing PHP from the list of targeted language. You can not declare sparse arrays in PHP. The following code does not compile:
----
$array = [1, 2, 3, , 4];
----
However, sparse arrays can also be seen as a feature of the language. In the following code, the array is defined with 3 values, but the internal representation of the array is a map, which will use 3 keys: ``++14++``, ``++15++`` and ``++42++``.