3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function letter2getal ($letter) { return ord($letter) - ord('a') + 1; } function word2getal($word) { $getal = 0; for ($i = 0; $i < strlen($word); $i++) { $getal += letter2getal($word[$i]); } return $getal; } var_dump(word2getal('keuzevak')); var_dump(word2getal('markeren')); var_dump(word2getal('kansspel'));
based on 563GD
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
int(102) int(85) int(97)