3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $multiplesOf3 = array(); $multiplesOf5 = array(); for($i = 1; $i <= 1000; $i++) { if($i % 3 == 0) $multiplesOf3[] = $i; if($i % 5 == 0) $multiplesOf5[] = $i; } $multiples = array_merge($multiplesOf3,$multiplesOf5); $multiples = array_sum($multiples); echo $multiples;