3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Unicode/multibyte capable equivelant of ord(). function charCodeAt($a, $b) { $a = mb_convert_encoding($a,"UCS-4BE","UTF-8"); $c = unpack("N", mb_substr($a,$b,1,"UCS-4BE")); return $c[1]; } // strToNum - Convert a string into a 32-bit integer. function strToNum ($str, $c, $k) { $Int32U = 4294967296; // 2^32 for ($i = 0; $i < mb_strlen($str); $i++) { $c *= $k; if (PHP_INT_MAX != 0x0000000080000000) { // 2147483647 $c = -(~($c & 0x00000000FFFFFFFF) + 1); } $c += charCodeAt($str, $i); } return $c; } function string_inthash($str) { $a = (int)preg_replace('#[^0-9]#u', '', sha1($str)) * (int)date('YmdHis'); if (PHP_INT_MAX != 0x0000000080000000) { // 2147483647 $a = -(~($a & 0x00000000FFFFFFFF) + 1); } return (int)$a; } $str = 'secret'; echo strToNum($str, 0x1505, 0x21); /* $a = date('YmdHi'); $b = 'secret'; $bb = sha1($b); $bc = preg_replace('#[^0-9]#u', '', $bb); $bd = (int)$bc - (int)$a; $c = "{$b}|{$a}"; $d = base64_encode($c); $e = base64_decode($d); echo $a . PHP_EOL; echo $b . PHP_EOL; echo $bb . PHP_EOL; echo $bc . PHP_EOL; echo $bd . PHP_EOL; echo $c . PHP_EOL; echo $d . PHP_EOL; echo $e . PHP_EOL; */
Output for git.master, git.master_jit, rfc.property-hooks
461122539

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:
65.39 ms | 401 KiB | 8 Q