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))); return ($index << $c) & 0xffffff; } function main() { $array = array(176, 52, 608, 855); foreach ($array as $value) { echo "$value: " . getCharacter($value) . "\n"; } } main();
Output for hhvm-3.12.0, 7.0.0 - 7.1.0
176: 0 52: 0 608: 0 855: 0
Output for 4.3.0 - 5.6.25, hhvm-3.10.0
176: 704 52: 0 608: 0 855: 12582912