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); echo base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, "boy10@naver.com", MCRYPT_MODE_CBC, $iv)); 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.60.0080.00816.50
8.3.50.0080.01221.14
8.3.40.0120.00318.88
8.3.30.0100.01019.02
8.3.20.0040.00420.16
8.3.10.0090.00023.65
8.3.00.0040.00423.59
8.2.180.0140.00718.54
8.2.170.0110.00422.96
8.2.160.0070.00720.54
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00319.88
8.2.120.0050.00326.35
8.2.110.0040.00422.20
8.2.100.0040.00817.93
8.2.90.0050.00319.20
8.2.80.0000.00817.97
8.2.70.0030.00717.63
8.2.60.0090.00017.87
8.2.50.0060.00318.07
8.2.40.0040.00422.18
8.2.30.0040.00420.54
8.2.20.0040.00417.84
8.2.10.0000.00818.26
8.2.00.0000.00818.03
8.1.280.0060.01325.92
8.1.270.0060.00322.05
8.1.260.0110.00028.09
8.1.250.0050.00328.09
8.1.240.0100.00022.17
8.1.230.0070.00418.93
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0090.00017.35
8.1.190.0030.00517.22
8.1.180.0030.00618.10
8.1.170.0000.00818.71
8.1.160.0040.00420.78
8.1.150.0040.00418.83
8.1.140.0070.00319.69
8.1.130.0000.00717.77
8.1.120.0000.00717.51
8.1.110.0040.00417.53
8.1.100.0040.00417.39
8.1.90.0030.00517.40
8.1.80.0030.00717.38
8.1.70.0000.00717.49
8.1.60.0040.00417.60
8.1.50.0030.00617.52
8.1.40.0040.00417.59
8.1.30.0080.00017.57
8.1.20.0000.00817.73
8.1.10.0000.00817.56
8.1.00.0070.00017.46
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.54
8.0.270.0040.00417.34
8.0.260.0060.00017.27
8.0.250.0030.00316.93
8.0.240.0070.00017.04
8.0.230.0070.00017.03
8.0.220.0040.00416.87
8.0.210.0070.00016.92
8.0.200.0000.00716.98
8.0.190.0030.00617.09
8.0.180.0070.00016.98
8.0.170.0030.00616.91
8.0.160.0040.00417.07
8.0.150.0040.00416.92
8.0.140.0000.01016.88
8.0.130.0000.00513.41
8.0.120.0050.00316.99
8.0.110.0050.00317.03
8.0.100.0000.00816.96
8.0.90.0030.00516.95
8.0.80.0030.01216.96
8.0.70.0000.00816.95
8.0.60.0040.00416.99
8.0.50.0040.00416.97
8.0.30.0090.01017.07
8.0.20.0110.00917.40
8.0.10.0040.00417.14
8.0.00.0060.01416.78
7.4.330.0060.00016.71
7.4.320.0030.00316.63
7.4.300.0030.00316.55
7.4.290.0030.00316.46
7.4.280.0080.00216.54
7.4.270.0000.00716.59
7.4.260.0030.00716.55
7.4.250.0050.00316.58
7.4.240.0000.00716.59
7.4.230.0000.00716.67
7.4.220.0130.01016.59
7.4.210.0060.00816.63
7.4.200.0000.00816.43
7.4.160.0030.01316.60
7.4.150.0060.01317.40
7.4.140.0120.00717.86
7.4.130.0120.00516.65
7.4.120.0080.01016.55
7.4.110.0060.01216.44
7.4.100.0110.00716.53
7.4.90.0060.01216.66
7.4.80.0100.00719.39
7.4.70.0090.00916.66
7.4.60.0100.01016.71
7.4.50.0060.00616.47
7.4.40.0080.00816.71
7.4.30.0120.00316.61
7.4.00.0030.01615.02
7.3.330.0060.00013.38
7.3.320.0050.00013.32
7.3.310.0040.00416.41
7.3.300.0000.00716.32
7.3.290.0030.00316.32
7.3.280.0060.01516.46
7.3.270.0040.01417.40
7.3.260.0060.01216.50
7.3.250.0110.00916.54
7.3.240.0100.00716.45
7.3.230.0140.00916.57
7.3.210.0100.00716.40
7.3.200.0170.00016.38
7.3.190.0060.01616.53
7.3.180.0070.01016.54
7.3.170.0070.01016.54
7.3.160.0070.01316.47
7.3.120.0110.00714.91
7.3.110.0140.00415.15
7.3.100.0100.00314.95
7.3.90.0060.00314.88
7.3.80.0000.01114.82
7.3.70.0000.01014.96
7.3.60.0080.00814.63
7.3.50.0090.00614.95
7.3.40.0110.00415.00
7.3.30.0090.00614.78
7.3.20.0030.00616.79
7.3.10.0060.00916.73
7.3.00.0150.00016.75
7.2.330.0070.01416.54
7.2.320.0040.01216.56
7.2.310.0070.01016.52
7.2.300.0350.01916.73
7.2.290.0070.01016.80
7.2.250.0060.01214.73
7.2.240.0070.01315.08
7.2.230.0040.01115.00
7.2.220.0060.01215.02
7.2.210.0000.01215.14
7.2.200.0030.01015.14
7.2.190.0030.01315.09
7.2.180.0090.00614.96
7.2.170.0030.01014.98
7.2.110.0160.00316.67
7.2.60.0090.00616.79
7.2.00.0100.00719.53
7.1.330.0030.01416.04
7.1.320.0030.01415.70
7.1.310.0040.00715.96
7.1.300.0060.00915.79
7.1.290.0040.00815.84
7.1.280.0040.00715.82
7.1.270.0040.01115.82
7.1.260.0120.00315.54
7.1.200.0080.00415.39
7.1.100.0090.00318.16
7.1.70.0000.01117.20
7.1.60.0090.01619.06
7.1.50.0000.02116.78
7.1.00.0100.07022.43
7.0.200.0200.00315.03
7.0.60.0000.08721.57
7.0.50.0030.06718.02
7.0.40.0070.06720.15
7.0.30.0330.07320.14
7.0.20.0330.07720.33
7.0.10.0070.04020.13
7.0.00.0030.04720.12
5.6.280.0030.03320.94
5.6.210.0070.08720.49
5.6.200.0100.08318.19
5.6.190.0100.04720.48
5.6.180.0370.07020.66
5.6.170.0200.04320.62
5.6.160.0130.06320.52
5.6.150.0130.07718.19
5.6.140.0070.04718.19
5.6.130.0030.05718.22
5.6.120.0030.05721.19
5.6.110.0130.06721.04
5.6.100.0070.08721.09
5.6.90.0070.05721.13
5.6.80.0030.05320.52
5.5.350.0070.08320.49
5.5.340.0070.04718.03
5.5.330.0100.05320.23
5.5.320.0600.05720.36
5.5.310.0270.03720.28
5.5.300.0000.08718.08
5.5.290.0100.07018.05
5.5.280.0070.08321.07
5.5.270.0130.06720.93
5.5.260.0030.05720.93
5.5.250.0030.07720.71
5.5.240.0170.06020.29

preferences:
42.53 ms | 401 KiB | 5 Q