3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = "03255000000"; $len = strlen($code); $i = 0; $r = 1; $sum = 0; do { $r = ($r > 10)?1:$r++; $s = ($code[$i]*$r); $sum = ($sum + $s); echo $i.": ".$code[$i]." * $r = $s sum = $sum\n"; $i++; $r++; }while($i < $len); echo (string)($sum%11); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
0: 0 * 1 = 0 sum = 0 1: 3 * 2 = 6 sum = 6 2: 2 * 3 = 6 sum = 12 3: 5 * 4 = 20 sum = 32 4: 5 * 5 = 25 sum = 57 5: 0 * 6 = 0 sum = 57 6: 0 * 7 = 0 sum = 57 7: 0 * 8 = 0 sum = 57 8: 0 * 9 = 0 sum = 57 9: 0 * 10 = 0 sum = 57 10: 0 * 1 = 0 sum = 57 2
Output for hhvm-3.10.0

Process exited with code 153.