3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(60,56.8,42.08,52.16,52.8); $array = array(60,56.8,42.08,52.16,52.8); while(count($array) > 0){ $first = array_shift($array); foreach($array as $value){ echo "$first + $value = " . ($first + $value) . "<br/>\n"; $result[] = $first + $value; } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
60 + 56.8 = 116.8<br/> 60 + 42.08 = 102.08<br/> 60 + 52.16 = 112.16<br/> 60 + 52.8 = 112.8<br/> 56.8 + 42.08 = 98.88<br/> 56.8 + 52.16 = 108.96<br/> 56.8 + 52.8 = 109.6<br/> 42.08 + 52.16 = 94.24<br/> 42.08 + 52.8 = 94.88<br/> 52.16 + 52.8 = 104.96<br/>