arrayutils
Search…
static of()
The of() static method creates a new, ArrayUtils instance from variadic function arguments
Example.php
1
<?php use kim\present\utils\arrays\ArrayUtils;
2
3
ArrayUtils::of(3,6,9);
4
// expected output: ArrayUtils(array(3, 6, 9))
Copied!

Syntax

1
ArrayUtils::of(mixed ...$elements) : ArrayUtils
Copied!

Parameter

  • ...$elements
    Elements used to create the array.

Return value

  • A new ArrayUtils instance.

References

Array.of() - JavaScript | MDN