3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pricePerDay = 800; $days = range(1,20); $arr = array(); foreach ($days as $day) { $price = ($day * $pricePerDay); $arr[$day] = $price; //echo sprintf('Dag: %s, Pris: %s ', $day, $price) . PHP_EOL; } return $arr;
based on 7jjWa
Output for 4.3.0 - 7.2.0