3v4l.org

run code in 300+ PHP versions simultaneously
<?php class xxtea { public function __construct($options) { parent::__construct($options); } public function encrypt($key, $salt = null) { if (is_null($salt)) { $strSalt = $this->salt; } else { $strSalt = $salt; } return str_replace(array('+', '/', '='), array('-', '_', '.'), base64_encode($this->xxteaEncrypt($key, $strSalt))); } public function decrypt($value, $salt = null) { if (is_null($salt)) { $strSalt = $this->salt; } else { $strSalt = $salt; } $strValue = str_replace(array('-', '_', '.'), array('+', '/', '='), $value); return $this->xxteaDecrypt(base64_decode($strValue), $strSalt); } 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 xxteaEncrypt($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 xxteaDecrypt($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.60.0130.00718.28
8.3.50.0120.00922.09
8.3.40.0140.00418.72
8.3.30.0110.00418.79
8.3.20.0040.00420.29
8.3.10.0000.00823.58
8.3.00.0000.00820.80
8.2.180.0090.00616.63
8.2.170.0000.01522.96
8.2.160.0100.01020.52
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0140.00726.16
8.2.120.0030.00520.76
8.2.110.0060.00322.21
8.2.100.0090.00317.84
8.2.90.0040.00419.14
8.2.80.0030.00517.97
8.2.70.0030.00717.50
8.2.60.0060.00317.92
8.2.50.0080.00018.07
8.2.40.0000.00718.16
8.2.30.0080.00318.21
8.2.20.0080.00017.51
8.2.10.0000.00817.95
8.2.00.0050.00317.58
8.1.280.0090.00925.92
8.1.270.0080.00021.89
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0050.00523.79
8.1.230.0060.00618.97
8.1.220.0080.00017.74
8.1.210.0030.00718.77
8.1.200.0030.00617.35
8.1.190.0030.00617.23
8.1.180.0000.00918.10
8.1.170.0050.00318.59
8.1.160.0040.00421.99
8.1.150.0000.00718.41
8.1.140.0040.00417.35
8.1.130.0000.00717.79
8.1.120.0050.00317.41
8.1.110.0040.00717.39
8.1.100.0000.00717.38
8.1.90.0040.00417.24
8.1.80.0040.00417.28
8.1.70.0000.00717.24
8.1.60.0040.00417.41
8.1.50.0030.00617.39
8.1.40.0000.00717.30
8.1.30.0030.00517.57
8.1.20.0000.00717.50
8.1.10.0050.00217.43
8.1.00.0000.00717.23
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0000.00818.34
8.0.270.0050.00217.22
8.0.260.0030.00317.07
8.0.250.0000.00716.93
8.0.240.0000.00716.88
8.0.230.0000.00716.77
8.0.220.0030.00316.73
8.0.210.0000.00716.75
8.0.200.0060.00016.81
8.0.190.0000.00816.79
8.0.180.0020.00516.92
8.0.170.0000.00816.91
8.0.160.0040.00416.73
8.0.150.0070.00016.69
8.0.140.0040.00416.71
8.0.130.0000.00513.26
8.0.120.0040.00416.76
8.0.110.0000.00716.80
8.0.100.0000.00716.82
8.0.90.0070.00016.80
8.0.80.0080.00816.84
8.0.70.0000.00716.90
8.0.60.0040.00416.89
8.0.50.0050.00316.68
8.0.30.0110.00717.08
8.0.20.0130.01117.40
8.0.10.0040.00416.85
8.0.00.0090.00916.60
7.4.330.0050.00015.00
7.4.320.0000.00716.58
7.4.300.0070.00016.53
7.4.290.0030.00316.55
7.4.280.0060.00316.45
7.4.270.0030.00316.63
7.4.260.0050.00316.48
7.4.250.0000.00716.38
7.4.240.0050.00216.56
7.4.230.0030.00316.45
7.4.220.0100.01716.56
7.4.210.0100.00316.56
7.4.200.0050.00216.36
7.4.160.0130.00316.57
7.4.150.0140.00417.40
7.4.140.0060.01217.86
7.4.130.0020.01516.52
7.4.120.0090.00916.50
7.4.110.0100.01316.57
7.4.100.0090.00916.39
7.4.90.0100.00716.37
7.4.80.0120.00919.39
7.4.70.0130.00416.46
7.4.60.0100.00916.58
7.4.50.0050.00516.30
7.4.40.0060.01216.57
7.4.30.0080.00816.44
7.4.00.0070.00715.11
7.3.330.0030.00313.30
7.3.320.0050.00013.41
7.3.310.0000.00716.26
7.3.300.0040.00416.40
7.3.290.0090.00616.36
7.3.280.0080.01116.43
7.3.270.0100.00717.40
7.3.260.0180.00616.72
7.3.250.0080.01016.63
7.3.240.0030.01316.37
7.3.230.0030.01816.39
7.3.210.0100.00716.63
7.3.200.0070.01119.39
7.3.190.0070.01416.39
7.3.180.0030.01316.26
7.3.170.0160.00016.37
7.3.160.0040.01116.55
7.3.120.0070.01014.91
7.3.110.0010.01514.89
7.3.100.0050.01214.82
7.3.90.0050.01014.83
7.3.80.0050.00914.84
7.3.70.0020.01114.87
7.3.60.0070.00514.74
7.3.50.0050.00914.77
7.3.40.0040.00814.82
7.3.30.0080.00714.86
7.3.20.0100.00616.68
7.3.10.0060.00816.51
7.3.00.0050.01016.38
7.2.330.0090.00916.68
7.2.320.0080.01616.73
7.2.310.0120.00616.48
7.2.300.0030.01716.60
7.2.290.0100.01316.44
7.2.250.0120.00715.04
7.2.240.0070.01014.72
7.2.230.0100.00614.94
7.2.220.0050.01014.98
7.2.210.0090.00214.87
7.2.200.0060.00614.80
7.2.190.0060.00615.00
7.2.180.0020.01115.03
7.2.170.0030.00915.07
7.2.160.0060.00314.81
7.2.150.0000.01216.81
7.2.140.0040.00816.87
7.2.130.0000.00916.83
7.2.120.0000.01416.98
7.2.110.0060.00616.89
7.2.100.0100.00716.50
7.2.90.0040.01416.79
7.2.80.0060.01016.60
7.2.70.0040.01516.75
7.2.60.0080.00516.70
7.2.50.0030.01316.84
7.2.40.0100.00716.91
7.2.30.0040.00816.68
7.2.20.0030.01216.82
7.2.10.0060.01016.77
7.2.00.0090.00617.85
7.1.330.0080.00415.56
7.1.320.0070.00615.65
7.1.310.0030.00615.59
7.1.300.0030.00715.60
7.1.290.0050.00915.53
7.1.280.0080.00615.53
7.1.270.0040.00715.49
7.1.260.0050.00915.46
7.1.250.0000.01215.42
7.1.240.0080.00415.66
7.1.230.0000.01115.65
7.1.220.0070.01015.60
7.1.210.0000.01515.65
7.1.200.0070.00615.53
7.1.190.0110.00415.63
7.1.180.0000.01015.60
7.1.170.0030.01015.42
7.1.160.0070.00715.57
7.1.150.0040.00815.76
7.1.140.0070.00715.35
7.1.130.0060.00315.42
7.1.120.0040.01115.57
7.1.110.0070.00715.80
7.1.100.0070.00216.80
7.1.90.0100.00315.71
7.1.80.0030.00915.78
7.1.70.0100.00316.36
7.1.60.0100.00717.48
7.1.50.0060.01016.21
7.1.40.0070.00715.50
7.1.30.0000.01015.32
7.1.20.0060.00815.61
7.1.10.0060.01015.73
7.1.00.0060.04018.92
7.0.330.0030.00915.40
7.0.320.0060.00614.95
7.0.310.0000.01815.34
7.0.300.0070.00715.21
7.0.290.0030.01014.99
7.0.280.0070.00315.23
7.0.270.0030.00615.28
7.0.260.0060.01015.14
7.0.250.0040.01115.37
7.0.240.0060.00615.36
7.0.230.0120.00315.55
7.0.220.0060.00915.33
7.0.210.0030.00915.37
7.0.200.0050.00715.91
7.0.190.0070.00715.36
7.0.180.0000.01415.37
7.0.170.0000.00815.49
7.0.160.0070.00415.40
7.0.150.0070.01015.33
7.0.140.0040.04018.70
7.0.130.0080.00615.46
7.0.120.0030.01315.27
7.0.110.0000.01015.11
7.0.100.0310.03317.84
7.0.90.0270.04617.68
7.0.80.0290.04117.66
7.0.70.0120.02817.66
7.0.60.0130.03517.78
7.0.50.0080.02417.95
7.0.40.0010.02916.70
7.0.30.0030.02616.69
7.0.20.0040.02516.55
7.0.10.0000.04216.76
7.0.00.0120.03516.75
5.6.400.0070.01014.38
5.6.390.0140.00014.29
5.6.380.0110.00414.13
5.6.370.0000.01714.30
5.6.360.0040.00414.39
5.6.350.0000.01514.33
5.6.340.0060.00914.25
5.6.330.0060.00314.45
5.6.320.0040.00814.14
5.6.310.0040.00714.27
5.6.300.0000.00914.41
5.6.290.0070.00713.99
5.6.280.0090.03617.53
5.6.270.0040.00814.25
5.6.260.0070.00714.63
5.6.250.0070.04217.33
5.6.240.0070.03417.40
5.6.230.0140.03717.43
5.6.220.0050.04217.34
5.6.210.0050.03617.57
5.6.200.0040.02517.63
5.6.190.0050.02517.69
5.6.180.0030.02617.75
5.6.170.0050.04017.70
5.6.160.0100.03517.54
5.6.150.0060.02317.62
5.6.140.0100.03717.71
5.6.130.0030.02717.66
5.6.120.0060.02417.80
5.6.110.0070.02717.64
5.6.100.0050.02717.74
5.6.90.0060.02317.63
5.6.80.0040.02317.41
5.6.70.0030.02517.34
5.6.60.0050.02317.20
5.6.50.0030.02117.35
5.6.40.0050.02417.41
5.6.30.0070.02417.36
5.6.20.0050.02517.36
5.6.10.0060.02317.25
5.6.00.0040.02217.35
5.5.380.0130.03317.36
5.5.370.0120.03317.21
5.5.360.0100.02317.43
5.5.350.0050.02817.18
5.5.340.0030.02517.52
5.5.330.0050.02517.56
5.5.320.0070.01817.65
5.5.310.0060.02117.66
5.5.300.0050.03317.50
5.5.290.0050.04417.45
5.5.280.0020.04117.47
5.5.270.0100.02617.64
5.5.260.0050.03217.38
5.5.250.0050.02717.26
5.5.240.0060.02517.16
5.5.230.0040.02417.33
5.5.220.0060.02717.23
5.5.210.0080.02417.25
5.5.200.0040.02417.27
5.5.190.0050.03217.13
5.5.180.0000.02917.26
5.5.170.0080.00614.21
5.5.160.0060.02517.14
5.5.150.0020.04617.12
5.5.140.0080.03817.25
5.5.130.0030.02717.01
5.5.120.0080.03317.09
5.5.110.0050.04717.27
5.5.100.0030.03717.14
5.5.90.0060.04117.10
5.5.80.0110.02317.18
5.5.70.0080.03617.17
5.5.60.0080.02816.95
5.5.50.0080.02616.96
5.5.40.0070.03817.27
5.5.30.0080.03317.10
5.5.20.0160.03317.04
5.5.10.0020.04717.15
5.5.00.0090.02316.99
5.4.450.0020.02615.25
5.4.440.0030.02615.18
5.4.430.0000.02515.18
5.4.420.0070.02315.11
5.4.410.0020.02215.21
5.4.400.0060.02214.85
5.4.390.0070.02014.91
5.4.380.0000.02615.04
5.4.370.0020.02215.12
5.4.360.0020.03215.00
5.4.350.0050.01815.00
5.4.340.0030.02114.82
5.4.330.0040.00811.17
5.4.320.0030.02315.00
5.4.310.0070.01814.96
5.4.300.0060.02114.95
5.4.290.0010.02914.79
5.4.280.0050.02515.11
5.4.270.0040.03415.00
5.4.260.0120.03414.90
5.4.250.0030.02414.98
5.4.240.0070.04215.03
5.4.230.0060.02815.04
5.4.220.0030.04414.85
5.4.210.0030.04014.99
5.4.200.0100.03315.09
5.4.190.0090.03815.04
5.4.180.0090.03714.80
5.4.170.0030.04314.88
5.4.160.0070.04015.13
5.4.150.0080.02014.86
5.4.140.0080.03813.73
5.4.130.0070.03813.66
5.4.120.0070.03713.70
5.4.110.0070.03613.59
5.4.100.0070.03813.47
5.4.90.0030.04413.51
5.4.80.0030.04113.68
5.4.70.0070.03713.54
5.4.60.0030.03913.62
5.4.50.0060.04013.74
5.4.40.0030.03513.71
5.4.30.0090.03613.66
5.4.20.0060.03613.70
5.4.10.0050.03913.71
5.4.00.0080.03713.23
5.3.290.0000.02612.73
5.3.280.0030.04012.54
5.3.270.0020.02412.66
5.3.260.0050.03912.65
5.3.250.0040.02212.73
5.3.240.0020.02912.57
5.3.230.0050.04012.52
5.3.220.0020.04212.51
5.3.210.0080.03812.46
5.3.200.0130.03012.40
5.3.190.0050.04212.44
5.3.180.0090.03712.52
5.3.170.0030.04112.54
5.3.160.0080.04212.66
5.3.150.0050.04012.46
5.3.140.0030.03812.46
5.3.130.0020.03012.54
5.3.120.0020.04312.46
5.3.110.0100.03712.53
5.3.100.0110.03312.17
5.3.90.0050.04312.24
5.3.80.0030.04012.29
5.3.70.0030.04012.23
5.3.60.0070.04212.23
5.3.50.0070.03712.26
5.3.40.0050.04312.24
5.3.30.0080.02612.13
5.3.20.0050.03511.99
5.3.10.0070.03811.97
5.3.00.0020.04111.84

preferences:
39.97 ms | 400 KiB | 5 Q