3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $KEY_BASE = str_split("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); $BASE = 62; $num = 11112887; $num = intval($num); $num = array_map('intval',str_split($num)); $result = ''; $remainder = 0; foreach ($num as $digit) { $remainder = $digit%$BASE; echo 'remainder '.$remainder; echo 'key remainder '.$KEY_BASE[$REM $result.=$KEY_BASE[$remainder]; //echo $digit; } echo $result;
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '$result' (T_VARIABLE), expecting ']' in /in/eSgFV on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting ']' in /in/eSgFV on line 14
Process exited with code 255.