<?php
$x=[10,15,50];
$y=[20,30,40];
$count=count($x);
for ($j = 0; $j <$count; $j++) {
$z[$j] = $x[$j] + $y[$j];
}
echo join(",", $x)."<br>";
echo join(",", $y)."<br>";
echo join(",", $z)."<br>";
//output
//10,15,50
//20,30,40
//30,45,90
?>