3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pricePerDay = 800; $days = range(1,20); foreach ($days as $day) { $price = ($day * $pricePerDay); echo sprintf('Dag: %s, Pris: %s ', $day, $price) . PHP_EOL; }
based on oXAlp
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
Dag: 1, Pris: 800 Dag: 2, Pris: 1600 Dag: 3, Pris: 2400 Dag: 4, Pris: 3200 Dag: 5, Pris: 4000 Dag: 6, Pris: 4800 Dag: 7, Pris: 5600 Dag: 8, Pris: 6400 Dag: 9, Pris: 7200 Dag: 10, Pris: 8000 Dag: 11, Pris: 8800 Dag: 12, Pris: 9600 Dag: 13, Pris: 10400 Dag: 14, Pris: 11200 Dag: 15, Pris: 12000 Dag: 16, Pris: 12800 Dag: 17, Pris: 13600 Dag: 18, Pris: 14400 Dag: 19, Pris: 15200 Dag: 20, Pris: 16000
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 1, Pris: 800 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 2, Pris: 1600 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 3, Pris: 2400 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 4, Pris: 3200 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 5, Pris: 4000 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 6, Pris: 4800 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 7, Pris: 5600 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 8, Pris: 6400 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 9, Pris: 7200 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 10, Pris: 8000 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 11, Pris: 8800 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 12, Pris: 9600 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 13, Pris: 10400 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 14, Pris: 11200 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 15, Pris: 12000 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 16, Pris: 12800 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 17, Pris: 13600 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 18, Pris: 14400 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 19, Pris: 15200 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7jjWa on line 8 Dag: 20, Pris: 16000 PHP_EOL