arrayutils
Search…
Suffix - As
Suffixing "As" to the chaining method for returns a pure array.

Suffixing "As" to the chaining method for returns a pure array. Method chaining breaks if you use this Suffix.

Example
is same to
$arr = ArrayUtils::from([1,2,3,4,5]);
var_export($arr->reverseAs());
//array (0 => 5, 1 => 4, 2 => 3, 3 => 2, 4 => 1)
$arr = ArrayUtils::from([1,2,3,4,5]);
var_export((array) $arr->reverse());
//array (0 => 5, 1 => 4, 2 => 3, 3 => 2, 4 => 1)
Last modified 3mo ago
Copy link