3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function sign_imei($str) { // sha1_64bitInt $u = unpack('N2', sha1($str, true)); $u2 = ($u[1] << 32) | $u[2]; return $u2 & 0x7fffffffffffffff; } echo sign_imei('11122223333');
based on h27dr
Output for 5.0.0 - 5.2.0, 5.2.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
5046424392600602526
Output for 5.2.1
9223372036767958942
Output for 4.3.2 - 4.4.9
Warning: Wrong parameter count for sha1() in /in/knJNg on line 4 Warning: unpack(): Type N: not enough input, need 4, have 0 in /in/knJNg on line 4 0
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for sha1() in /in/knJNg on line 4 Warning: unpack() [http://www.php.net/function.unpack]: Type N: not enough input, need 4, have 0 in /in/knJNg on line 4 0