3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function roll_d6() { return intval(round(rand() * 6)); } switch ( roll_d6() ) { case 1: echo 'One. Unlucky!'; break; case 2: case 3: case 4: case 5: echo 'Meh. Not bad.'; break; case 6: echo 'Yay! A six!'; break; default: echo 'Huh? I think this dice is broken...'; break; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Huh? I think this dice is broken...