3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php { $keyLen=count($arrKey); $hash=5381; $i=0 for(;$keyLen>=8;$keyLen-=8) { $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; $hash=(($hash<<5)+$hash)+$arrKey[$i++]; } switch($keyLen) { case 7: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 6: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 5: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 4: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 3: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 2: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 1: $hash=(($hash<<5)+$hash)+$arrKey[$i++]; case 0: default: break; } return $hash; } $arrInput=explode(",","0,1,2,3,4,5,6,7,8,9,1,2,3,4,5"); echo hashCalc($arrInput);
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected 'for' (T_FOR) in /in/j7UY8 on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_FOR in /in/j7UY8 on line 7
Process exited with code 255.