3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $notes = array(1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6); foreach ($notes as $note) { echo '(3.5 + '.$note.') / 2 = '.round((3.5 / $note) / 2, 2); }
Output for 4.3.0 - 7.1.0
(3.5 + 1) / 2 = 1.75(3.5 + 1.5) / 2 = 1.17(3.5 + 2) / 2 = 0.88(3.5 + 2.5) / 2 = 0.7(3.5 + 3) / 2 = 0.58(3.5 + 3.5) / 2 = 0.5(3.5 + 4) / 2 = 0.44(3.5 + 4.5) / 2 = 0.39(3.5 + 5) / 2 = 0.35(3.5 + 5.5) / 2 = 0.32(3.5 + 6) / 2 = 0.29