> For the complete documentation index, see [llms.txt](https://arrayutils.docs.present.kim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arrayutils.docs.present.kim/methods/c/fill/keys.md).

# fillKeys()

{% code title="Example.php" %}

```php
<?php use kim\present\utils\arrays\ArrayUtils;

$arrayUtils = ArrayUtils::from(["first", "second", "third"]);

//Fill keys with 0
$arrayUtils->fillKeys(0);
// expected output: ["first" => 0, "second" => 0, "third" => 0]
```

{% endcode %}

## Syntax

```php
$arrayUtils->fillKeys(mixed $value) : ArrayUtils;
```

### Parameter

* `$value`&#x20;

  > Value to fill the array with.

### Return value

* A filled array.

## Prefixing

```php
$arrayUtils->fillKeysAs(mixed $value) : array;
```

```php
ArrayUtils::fillKeysFrom(iterable $from, mixed $value) : ArrayUtils;
```

```php
ArrayUtils::fillKeysFromAs(iterable $from, mixed $value) : array;
```

## References

{% embed url="<https://www.php.net/manual/en/function.array-fill-keys>" %}
