3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getCharacter($index) { $chars = "0123456789ABCDEFGHIJKLMOPQRSTUVWabcdefghijklmnopqrstuvw"; $c = ord(substr($chars, $index % strlen($chars))); return ord(substr($chars, ($index << $c) % strlen($chars))); } function main() { $array = array(176, 52, 608, 855); foreach ($array as $value) { echo "$value: " . getCharacter($value) . "\n"; } } main();
Output for 7.0.0 - 7.1.0
176: 48 52: 48 608: 104 855: 48
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0
176: 109 52: 57 608: 104 855: 65