3v4l.org

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