3v4l.org

run code in 300+ PHP versions simultaneously
<?php class xxtea { function __construct(){ } function __destruct(){ } public function encrypt($s,$key = "!@#^~ku6&%(com)T"){ return str_replace(array('+','/','='), array('-','_','.'), base64_encode($this->xxtea_encrypt($s, $key))); } public function decrypt($e,$key = "!@#^~ku6&%(com)T"){ $c = str_replace(array('-','_','.'), array('+','/','='), $e); return $this->xxtea_decrypt(base64_decode($c), $key); } private function long2str($v, $w) { $len = count($v); $n = ($len - 1) << 2; if ($w) { $m = $v[$len - 1]; if (($m < $n - 3) || ($m > $n)) return false; $n = $m; } $s = array(); for ($i = 0; $i < $len; $i++) { $s[$i] = pack("V", $v[$i]); } if ($w) { return substr(join('', $s), 0, $n); } else { return join('', $s); } } private function str2long($s, $w) { $v = unpack("V*", $s. str_repeat("\0", (4 - strlen($s) % 4) & 3)); $v = array_values($v); if ($w) { $v[count($v)] = strlen($s); } return $v; } private function int32($n) { while ($n >= 2147483648) $n -= 4294967296; while ($n <= -2147483649) $n += 4294967296; return (int)$n; } private function xxtea_encrypt($str, $key) { if ($str == "") { return ""; } $v = $this->str2long($str, true); $k = $this->str2long($key, false); if (count($k) < 4) { for ($i = count($k); $i < 4; $i++) { $k[$i] = 0; } } $n = count($v) - 1; $z = $v[$n]; $y = $v[0]; $delta = 0x9E3779B9; $q = floor(6 + 52 / ($n + 1)); $sum = 0; while (0 < $q--) { $sum = $this->int32($sum + $delta); $e = $sum >> 2 & 3; for ($p = 0; $p < $n; $p++) { $y = $v[$p + 1]; $mx = $this->int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ $this->int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z)); $z = $v[$p] = $this->int32($v[$p] + $mx); } $y = $v[0]; $mx = $this->int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ $this->int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z)); $z = $v[$n] = $this->int32($v[$n] + $mx); } return $this->long2str($v, false); } private function xxtea_decrypt($str, $key) { if ($str == "") { return ""; } $v = $this->str2long($str, false); $k = $this->str2long($key, false); if (count($k) < 4) { for ($i = count($k); $i < 4; $i++) { $k[$i] = 0; } } $n = count($v) - 1; $z = $v[$n]; $y = $v[0]; $delta = 0x9E3779B9; $q = floor(6 + 52 / ($n + 1)); $sum = $this->int32($q * $delta); while ($sum != 0) { $e = $sum >> 2 & 3; for ($p = $n; $p > 0; $p--) { $z = $v[$p - 1]; $mx = $this->int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ $this->int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z)); $y = $v[$p] = $this->int32($v[$p] - $mx); } $z = $v[$n]; $mx = $this->int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ $this->int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z)); $y = $v[0] = $this->int32($v[0] - $mx); $sum = $this->int32($sum - $delta); } return $this->long2str($v, true); } } $xxtea = new xxtea(); $vid = $xxtea->decrypt('xSz5rd55YacQwj-sjO8VbQ..', 'KU_6com-2007web2.0'); var_dump($vid);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.40.0150.00018.91
8.3.30.0040.01119.22
8.3.20.0040.00420.32
8.3.10.0040.00423.69
8.3.00.0040.00421.01
8.2.170.0110.00722.96
8.2.160.0140.00020.43
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0180.00326.16
8.2.120.0080.00020.89
8.2.110.0060.00320.35
8.2.100.0070.00418.03
8.2.90.0050.00319.17
8.2.80.0030.00617.97
8.2.70.0000.00917.63
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0040.00418.34
8.2.30.0030.00618.43
8.2.20.0040.00417.81
8.2.10.0000.00818.24
8.2.00.0080.00017.88
8.1.270.0000.00922.39
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00924.00
8.1.230.0080.00418.92
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0040.00418.59
8.1.160.0000.00822.12
8.1.150.0050.00318.70
8.1.140.0040.00417.50
8.1.130.0000.00717.94
8.1.120.0000.00717.54
8.1.110.0030.00617.51
8.1.100.0000.00717.49
8.1.90.0000.00717.55
8.1.80.0000.00817.54
8.1.70.0070.00017.46
8.1.60.0040.00417.58
8.1.50.0030.00617.57
8.1.40.0040.00417.46
8.1.30.0000.00817.69
8.1.20.0000.00817.71
8.1.10.0080.00017.61
8.1.00.0050.00317.59
8.0.300.0040.00419.21
8.0.290.0030.00616.63
8.0.280.0030.00318.50
8.0.270.0000.00717.24
8.0.260.0000.00717.23
8.0.250.0000.00717.04
8.0.240.0000.00817.07
8.0.230.0040.00417.03
8.0.220.0030.00316.96
8.0.210.0030.00316.86
8.0.200.0030.00317.01
8.0.190.0050.00316.91
8.0.180.0030.00617.01
8.0.170.0030.00616.95
8.0.160.0040.00416.95
8.0.150.0040.00416.88
8.0.140.0030.00616.85
8.0.130.0000.00613.34
8.0.120.0040.00416.83
8.0.110.0050.00216.86
8.0.100.0040.00416.89
8.0.90.0000.00716.79
8.0.80.0150.00316.95
8.0.70.0060.00316.98
8.0.60.0050.00316.94
8.0.50.0030.00516.82
8.0.30.0120.00617.20
8.0.20.0130.01117.44
8.0.10.0040.00416.93
8.0.00.0100.00916.90
7.4.330.0020.00215.03
7.4.320.0030.00316.66
7.4.300.0070.00016.69
7.4.290.0030.00316.64
7.4.280.0110.00016.45
7.4.270.0000.00816.56
7.4.260.0030.00616.64
7.4.250.0050.00216.64
7.4.240.0000.00716.61
7.4.230.0000.00716.46
7.4.220.0190.00616.73
7.4.210.0090.00916.69
7.4.200.0040.00416.74
7.4.160.0060.00916.65
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0100.00816.61
7.4.120.0140.00316.55
7.4.110.0060.01516.51
7.4.100.0120.00616.63
7.4.90.0090.00916.62
7.4.80.0110.01119.39
7.4.70.0170.00316.70
7.4.60.0040.01516.54
7.4.50.0090.00016.65
7.4.40.0160.00316.49
7.4.30.0090.00816.62
7.4.00.0070.00714.89
7.3.330.0030.00313.50
7.3.320.0000.00513.48
7.3.310.0050.00316.46
7.3.300.0040.00416.40
7.3.290.0100.01016.36
7.3.280.0070.01216.44
7.3.270.0090.01017.40
7.3.260.0130.01016.47
7.3.250.0050.01416.50
7.3.240.0030.01616.41
7.3.230.0120.00916.41
7.3.210.0100.00716.59
7.3.200.0060.00919.39
7.3.190.0070.01316.46
7.3.180.0120.00416.34
7.3.170.0150.00616.45
7.3.160.0060.00916.71
7.3.120.0040.01215.14
7.3.110.0100.00314.80
7.3.100.0000.01415.18
7.3.90.0100.00315.12
7.3.80.0000.01414.75
7.3.70.0090.00614.91
7.3.60.0030.01014.76
7.3.50.0060.01014.80
7.3.40.0030.01014.70
7.3.30.0060.00615.00
7.3.20.0110.00316.70
7.3.10.0100.00716.78
7.3.00.0120.00016.80
7.2.330.0100.01316.62
7.2.320.0370.02317.02
7.2.310.0060.01216.97
7.2.300.0090.01216.76
7.2.290.0160.00816.80
7.2.240.0000.01415.13
7.2.230.0030.01315.27
7.2.220.0070.00315.44
7.2.210.0030.01015.32
7.2.200.0060.00915.38
7.2.190.0060.00915.27
7.2.180.0040.01115.40
7.2.170.0070.00715.03
7.2.160.0040.01415.07
7.2.150.0070.00317.05
7.2.140.0110.00717.07
7.2.130.0070.01017.04
7.2.120.0070.01017.09
7.2.110.0070.01017.07
7.2.100.0040.01416.98
7.2.90.0040.00816.99
7.2.80.0090.00617.10
7.2.70.0080.00317.01
7.2.60.0030.01317.02
7.2.50.0060.00916.84
7.2.40.0030.00716.74
7.2.30.0060.00916.91
7.2.20.0080.00817.12
7.2.10.0060.00617.02
7.2.00.0080.00518.18
7.1.330.0090.00615.79
7.1.320.0070.00315.93
7.1.310.0030.00615.91
7.1.300.0030.01015.77
7.1.290.0000.01015.64
7.1.280.0060.00315.92
7.1.270.0080.00315.96
7.1.260.0100.00015.79
7.1.250.0060.00315.67
7.1.200.0100.00315.69
7.1.100.0170.01016.47
7.1.70.0000.00817.38
7.1.60.0030.02119.70
7.1.50.0130.01016.90
7.1.00.0000.08022.30
7.0.200.0000.00816.76
7.0.140.0030.06322.09
7.0.100.0030.04720.00
7.0.90.0130.03320.02
7.0.80.0170.05020.09
7.0.70.0070.03720.23
7.0.60.0100.03320.13
7.0.50.0100.03720.32
7.0.40.0000.04319.95
7.0.30.0070.04020.13
7.0.20.0170.03020.14
7.0.10.0030.04320.07
7.0.00.0070.04020.13
5.6.280.0070.07321.07
5.6.250.0100.03720.74
5.6.240.0000.04720.69
5.6.230.0000.05320.64
5.6.220.0000.04720.57
5.6.210.0130.03320.71
5.6.200.0000.04721.16
5.6.190.0070.04021.13
5.6.180.0170.02721.18
5.6.170.0070.05321.06
5.6.160.0030.05321.02
5.6.150.0100.04021.07
5.6.140.0100.04021.06
5.6.130.0030.04721.18
5.6.120.0100.04021.14
5.6.110.0030.04021.21
5.6.100.0100.06321.16
5.6.90.0030.06320.98
5.6.80.0100.07720.48
5.6.70.0000.05720.46
5.6.60.0100.07720.37
5.6.50.0200.07020.54
5.6.40.0070.08020.50
5.6.30.0100.07320.35
5.6.20.0070.03320.33
5.6.10.0030.08720.51
5.6.00.0070.07020.40
5.5.380.0100.03720.46
5.5.370.0070.04020.62
5.5.360.0070.04020.49
5.5.350.0000.04320.39
5.5.340.0000.04720.86
5.5.330.0130.03020.70
5.5.320.0070.04320.88
5.5.310.0000.04720.93
5.5.300.0030.04720.88
5.5.290.0000.04720.97
5.5.280.0070.04720.88
5.5.270.0070.04320.96
5.5.260.0100.07320.80
5.5.250.0030.03720.66
5.5.240.0100.07320.35
5.5.230.0100.03320.31
5.5.220.0000.04020.15
5.5.210.0100.03320.23
5.5.200.0100.06720.16
5.5.190.0070.04720.29
5.5.180.0070.04320.26
5.5.160.0130.07020.27
5.5.150.0030.03720.17
5.5.140.0000.06320.27
5.5.130.0030.04020.29
5.5.120.0100.07320.22
5.5.110.0070.08020.30
5.5.100.0030.04320.12
5.5.90.0030.06720.11
5.5.80.0130.06320.14
5.5.70.0100.07720.19
5.5.60.0070.08020.10
5.5.50.0070.05320.21
5.5.40.0070.06020.09
5.5.30.0030.03720.07
5.5.20.0030.04020.13
5.5.10.0100.07020.09
5.5.00.0100.07320.08
5.4.450.0030.04319.44
5.4.440.0100.03319.23
5.4.430.0070.04019.27
5.4.420.0070.04719.50
5.4.410.0000.07019.24
5.4.400.0000.07719.03
5.4.390.0000.04018.95
5.4.380.0070.06718.85
5.4.370.0100.07019.05
5.4.360.0130.07019.18
5.4.350.0100.06319.15
5.4.340.0000.06719.05
5.4.320.0030.04019.04
5.4.310.0030.03719.14
5.4.300.0100.06718.82
5.4.290.0000.03719.05
5.4.280.0030.07719.06
5.4.270.0070.05019.20
5.4.260.0070.04019.21
5.4.250.0100.06018.89
5.4.240.0070.06019.20
5.4.230.0100.06719.11
5.4.220.0130.05719.03
5.4.210.0000.05319.08
5.4.200.0100.03719.12
5.4.190.0000.04019.08
5.4.180.0070.03719.04
5.4.170.0130.06018.93
5.4.160.0070.05718.83
5.4.150.0130.06319.21
5.4.140.0100.06716.47
5.4.130.0130.05716.45
5.4.120.0070.06016.47
5.4.110.0030.05716.48
5.4.100.0070.04016.56
5.4.90.0000.04716.57
5.4.80.0130.06316.47
5.4.70.0070.06716.48
5.4.60.0030.06016.46
5.4.50.0070.07316.54
5.4.40.0100.07016.53
5.4.30.0170.05716.49
5.4.20.0000.07016.53
5.4.10.0100.07016.41
5.4.00.0070.06315.91
5.3.290.0070.06014.86
5.3.280.0030.03714.70
5.3.270.0030.08014.63
5.3.260.0130.02714.73
5.3.250.0030.06714.78
5.3.240.0030.07314.59
5.3.230.0030.05314.62
5.3.220.0100.08014.68
5.3.210.0100.06714.69
5.3.200.0030.03714.76
5.3.190.0100.06014.73
5.3.180.0030.07314.61
5.3.170.0070.06314.71
5.3.160.0070.05014.68
5.3.150.0030.04314.65
5.3.140.0030.04714.59
5.3.130.0100.07014.58
5.3.120.0130.04014.59
5.3.110.0030.07314.61
5.3.100.0070.03714.15
5.3.90.0100.07014.03
5.3.80.0070.05014.19
5.3.70.0070.03014.21
5.3.60.0000.08013.96
5.3.50.0100.04314.08
5.3.40.0130.04013.94
5.3.30.0070.06713.98
5.3.20.0030.07713.68
5.3.10.0070.03313.69
5.3.00.0070.06313.83

preferences:
37.9 ms | 400 KiB | 5 Q