3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dec = Decrypt("wpdPVWejqNRYqDTeUJ2Iw06/rnfHAoy5jtgTojiilD0=", "ICS2015", "7"); echo "Dec: " . $dec . "\r\n"; $enc = Encrypt("boy10@naver.com", "ICS2015", "7"); echo "Enc: " . $enc . "\r\n"; function Decrypt($ciphertext, $password, $salt) { $ciphertext = base64_decode($ciphertext); $key = PBKDF1($password, $salt, 100, 32); $iv = PBKDF1($password, $salt, 100, 16); // NB: Need 128 not 256 and CBC mode to be compatible $decpad = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $ciphertext, MCRYPT_MODE_CBC, $iv); $pad = ord($decpad[($len = strlen($decpad)) - 1]); $dec = substr($decpad, 0, strlen($decpad) - $pad); return $dec; } function Encrypt($ciphertext, $password, $salt) { $key = PBKDF1($password, $salt, 100, 32); $iv = PBKDF1($password, $salt, 100, 16); return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $ciphertext, MCRYPT_MODE_CBC, $iv)); } function PBKDF1($pass, $salt, $count, $cb) { static $base; static $extra; static $extracount= 0; static $hashno; static $state = 0; if ($state == 0) { $hashno = 0; $state = 1; $key = $pass . $salt; $base = sha1($key, true); for($i = 2; $i < $count; $i++) { $base = sha1($base, true); } } $result = ""; if ($extracount > 0) { $rlen = strlen($extra) - $extracount; if ($rlen >= $cb) { $result = substr($extra, $extracount, $cb); if ($rlen > $cb) { $extracount += $cb; } else { $extra = null; $extracount = 0; } return $result; } $result = substr($extra, $rlen, $rlen); } $current = ""; $clen = 0; $remain = $cb - strlen($result); while ($remain > $clen) { if ($hashno == 0) { $current = sha1($base, true); } else if ($hashno < 1000) { $n = sprintf("%d", $hashno); $tmp = $n . $base; $current .= sha1($tmp, true); } $hashno++; $clen = strlen($current); } // $current now holds at least as many bytes as we need $result .= substr($current, 0, $remain); // Save any left over bytes for any future requests if ($clen > $remain) { $extra = $current; $extracount = $remain; } return $result; } ?>

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.70.0040.01116.63
8.3.60.0180.00416.75
8.3.50.0130.00521.20
8.3.40.0070.00718.85
8.3.30.0150.00618.84
8.3.20.0000.00720.30
8.3.10.0060.00323.66
8.3.00.0000.00823.48
8.2.180.0140.00718.29
8.2.170.0030.01318.93
8.2.160.0110.00422.96
8.2.150.0100.00024.18
8.2.140.0050.00324.66
8.2.130.0060.00318.21
8.2.120.0080.00026.35
8.2.110.0100.00022.31
8.2.100.0040.00718.02
8.2.90.0040.00418.16
8.2.80.0040.00419.03
8.2.70.0030.00617.75
8.2.60.0000.00918.05
8.2.50.0060.00318.07
8.2.40.0000.00822.34
8.2.30.0050.00220.69
8.2.20.0000.00717.90
8.2.10.0030.00518.02
8.2.00.0000.00718.02
8.1.280.0140.00425.92
8.1.270.0030.00622.05
8.1.260.0030.00528.09
8.1.250.0030.00528.09
8.1.240.0000.00922.09
8.1.230.0040.00720.98
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00617.48
8.1.190.0080.00017.35
8.1.180.0050.00318.10
8.1.170.0040.00418.51
8.1.160.0040.00420.79
8.1.150.0000.00818.89
8.1.140.0040.00419.71
8.1.130.0000.00717.70
8.1.120.0040.00417.54
8.1.110.0000.00717.47
8.1.100.0080.00017.52
8.1.90.0000.00717.38
8.1.80.0070.00417.26
8.1.70.0000.00717.45
8.1.60.0050.00317.48
8.1.50.0040.00417.36
8.1.40.0030.00617.43
8.1.30.0000.00817.57
8.1.20.0040.00417.52
8.1.10.0000.00817.67
8.1.00.0000.00817.51
8.0.300.0060.00320.02
8.0.290.0080.00016.75
8.0.280.0000.00718.46
8.0.270.0040.00417.16
8.0.260.0000.00617.35
8.0.250.0080.00017.02
8.0.240.0030.00316.96
8.0.230.0040.00416.94
8.0.220.0050.00316.97
8.0.210.0000.00816.98
8.0.200.0030.00317.02
8.0.190.0030.00516.98
8.0.180.0000.00717.01
8.0.170.0060.00317.03
8.0.160.0040.00416.91
8.0.150.0040.00416.96
8.0.140.0040.00416.86
8.0.130.0000.00713.34
8.0.120.0000.00716.94
8.0.110.0000.00716.96
8.0.100.0040.00416.91
8.0.90.0030.00517.07
8.0.80.0090.00916.92
8.0.70.0000.00716.88
8.0.60.0030.00616.88
8.0.50.0000.00817.00
8.0.30.0110.00917.20
8.0.20.0100.00917.40
8.0.10.0000.00816.94
8.0.00.0090.01116.69
7.4.330.0000.00516.73
7.4.320.0030.00316.51
7.4.300.0000.00716.61
7.4.290.0070.00016.64
7.4.280.0030.00716.44
7.4.270.0070.00016.46
7.4.260.0080.00216.41
7.4.250.0030.00316.59
7.4.240.0060.00216.57
7.4.230.0030.00316.52
7.4.220.0080.01216.56
7.4.210.0010.01316.61
7.4.200.0050.00316.53
7.4.160.0040.01316.63
7.4.150.0090.00917.40
7.4.140.0150.00917.86
7.4.130.0080.00916.61
7.4.120.0060.01216.63
7.4.110.0120.00816.46
7.4.100.0100.01016.45
7.4.90.0090.00916.54
7.4.80.0070.01119.39
7.4.70.0060.01216.57
7.4.60.0070.01116.56
7.4.50.0080.00316.50
7.4.40.0060.01116.64
7.4.30.0080.00816.31
7.4.00.0070.01014.97
7.3.330.0020.00213.32
7.3.320.0000.00513.41
7.3.310.0050.00216.36
7.3.300.0030.00316.32
7.3.290.0030.00316.32
7.3.280.0050.01016.43
7.3.270.0170.00217.40
7.3.260.0070.01016.66
7.3.250.0100.00916.47
7.3.240.0120.00616.45
7.3.230.0150.00316.64
7.3.210.0030.01516.44
7.3.200.0130.00316.46
7.3.190.0030.01216.42
7.3.180.0070.01316.60
7.3.170.0140.00416.58
7.3.160.0130.01016.53
7.3.10.0090.00616.70
7.3.00.0060.01016.87
7.2.330.0060.01216.77
7.2.320.0090.00916.73
7.2.310.0110.00716.49
7.2.300.0090.00916.87
7.2.290.0090.00916.63
7.2.130.0070.00716.98
7.2.120.0040.01116.61
7.2.110.0070.00916.85
7.2.100.0040.00816.88
7.2.90.0030.01316.71
7.2.80.0000.01416.77
7.2.70.0100.00716.75
7.2.60.0060.00816.83
7.2.50.0040.00716.85
7.2.40.0100.00717.02
7.2.30.0100.00716.88
7.2.20.0030.01116.97
7.2.10.0000.00916.77
7.2.00.0020.01218.18
7.1.250.0040.00415.90
7.1.200.0060.00615.77
7.1.100.0030.01018.39
7.1.70.0080.00817.25
7.1.60.0130.01319.06
7.1.50.0060.01316.99
7.1.00.0030.08022.45
7.0.200.0260.00015.00
7.0.60.0000.08021.59
7.0.50.0100.04718.18
7.0.40.0070.06319.96
7.0.30.0270.05020.16
7.0.20.0230.06720.17
7.0.10.0130.08020.12
7.0.00.0100.09020.33
5.6.280.0070.03021.10
5.6.210.0100.06320.50
5.6.200.0070.07018.15
5.6.190.0030.04320.65
5.6.180.0300.07020.66
5.6.170.0170.05020.59
5.6.160.0070.07020.71
5.6.150.0030.08718.19
5.6.140.0070.06018.22
5.6.130.0070.04318.25
5.6.120.0100.05021.11
5.6.110.0100.06021.09
5.6.100.0100.08021.04
5.6.90.0130.05721.11
5.6.80.0070.03720.55
5.5.350.0030.08320.38
5.5.340.0000.05717.97
5.5.330.0070.05320.30
5.5.320.0570.07020.28
5.5.310.0170.08320.30
5.5.300.0100.03718.02
5.5.290.0030.04318.05
5.5.280.0070.08020.70
5.5.270.0100.08020.88
5.5.260.0130.08320.66
5.5.250.0030.09020.65
5.5.240.0030.07020.45

preferences:
39.79 ms | 401 KiB | 5 Q