3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(60,56.8,42.08,52.16,52.8); while(count($array) > 0){ $first = array_shift($array); foreach($array as $value){ $result[] = $first + $value; } } var_dump($result);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(10) { [0]=> float(116.8) [1]=> float(102.08) [2]=> float(112.16) [3]=> float(112.8) [4]=> float(98.88) [5]=> float(108.96) [6]=> float(109.6) [7]=> float(94.24) [8]=> float(94.88) [9]=> float(104.96) }