For the complete documentation index, see llms.txt. This page is also available as Markdown.

fillKeys()

The fillKeys() method fills an array with the static value, using the values of the array as keys.

Example.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]

Syntax

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

Parameter

  • $value

    Value to fill the array with.

Return value

  • A filled array.

Prefixing

References

Last updated