php Undefined Offset in simple function()
Your array has three elements at index 0, 1 and 2. There is no element with index 3.
Your loop should stop before it hits that...
for($i=0;$i<sizeof($numbers); $i++) {
}
Also, checkout array_sum, which might be what you're wanting anyway...
$total=array_sum($numbers);