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); } 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: 0 52: 0 608: 1369094286720630784 855: 0
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0
176: 704 52: 468374361246531584 608: 1369094286720630784 855: 3586129920