Copy an array
SciPhp\NdArray
NdArray::copy()
This function has no parameters.
The new SciPhp\NdArray
use SciPhp\NumPhp as np;
$x = np::linspace(1, 6, 6)->resize(3, 3);
$y = $x->copy()->resize(2, 6);
echo "x\n$x", "y\n$y";
The above example will output:
x [[1 2 3] [4 5 6] [1 2 3]] y [[1 2 3 4 5 6] [1 2 3 1 2 3]]