private static function isCompactableArray($value, $integerKeysIncluded)
    {
        if (!is_array($value)) {
            return false;
        }
        reset($value);
        $firstKey = key($value);
        if (!$integerKeysIncluded && self::isInteger($firstKey)) {
            return false;
        }
        next($value);
        return key($value) === null; // if the array only has one key, then the second key is null.
    }