3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hashCalc($arrKey) { $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 git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 1.3712707475956173E+19 to int loses precision in /in/26aTk on line 23 Deprecated: Implicit conversion from float 9.797488937524464E+18 to int loses precision in /in/26aTk on line 24 Deprecated: Implicit conversion from float 9.722485685244922E+18 to int loses precision in /in/26aTk on line 25 -6.4418707756273E+17

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
30.18 ms | 402 KiB | 8 Q