Version: v0.6.0 - Beta.  We welcome contributors & feedback.  THanks!

List.copy

copy()

Description

Copy the List into a new List.

$list1 = [1, 2, 3];
$list2 = $list1.copy();

$list1[0] = 11;
$list2[0] = 22;

print($list1);  //= [11, 2, 3]
print($list2);  //= [22, 2, 3]