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.40.0120.00319.02
8.3.30.0120.00918.74
8.3.20.0000.00820.16
8.3.10.0040.00423.69
8.3.00.0040.00423.53
8.2.170.0070.00722.96
8.2.160.0080.00520.32
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0080.00019.77
8.2.120.0080.00326.35
8.2.110.0060.00322.25
8.2.100.0040.00818.14
8.2.90.0060.00319.20
8.2.80.0060.00317.97
8.2.70.0090.00017.75
8.2.60.0030.00517.75
8.2.50.0060.00317.63
8.2.40.0040.00417.75
8.2.30.0000.00720.56
8.2.20.0040.00417.75
8.2.10.0040.00418.19
8.2.00.0040.00418.06
8.1.270.0090.00022.05
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0060.00323.80
8.1.230.0110.00019.00
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0080.00317.48
8.1.190.0030.00617.23
8.1.180.0080.00018.10
8.1.170.0070.00018.95
8.1.160.0040.00420.80
8.1.150.0060.00318.91
8.1.140.0030.00919.51
8.1.130.0070.00017.73
8.1.120.0070.00017.40
8.1.110.0000.00717.48
8.1.100.0040.00417.38
8.1.90.0000.00817.47
8.1.80.0040.00817.39
8.1.70.0000.00817.40
8.1.60.0000.00717.57
8.1.50.0040.00417.39
8.1.40.0030.00517.55
8.1.30.0030.00517.52
8.1.20.0020.00517.71
8.1.10.0040.00417.50
8.1.00.0050.00317.53
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.39
8.0.270.0000.00717.29
8.0.260.0000.00617.25
8.0.250.0030.00317.02
8.0.240.0030.00317.05
8.0.230.0000.00717.02
8.0.220.0040.00416.88
8.0.210.0060.00316.86
8.0.200.0030.00317.04
8.0.190.0030.00617.03
8.0.180.0040.00416.98
8.0.170.0030.00617.02
8.0.160.0040.00417.00
8.0.150.0040.00416.95
8.0.140.0020.00516.87
8.0.130.0000.00713.40
8.0.120.0070.00316.86
8.0.110.0000.00716.99
8.0.100.0000.00716.89
8.0.90.0000.00717.03
8.0.80.0040.01317.02
8.0.70.0070.00017.01
8.0.60.0040.00416.99
8.0.50.0040.00416.79
8.0.30.0080.01217.11
8.0.20.0090.01017.40
8.0.10.0000.00817.16
8.0.00.0110.00916.92
7.4.330.0000.00516.85
7.4.320.0050.00216.41
7.4.300.0000.00616.53
7.4.290.0030.00316.47
7.4.280.0070.00316.54
7.4.270.0030.00316.64
7.4.260.0070.00016.62
7.4.250.0070.00016.60
7.4.240.0040.00416.61
7.4.230.0040.00416.44
7.4.220.0140.01216.48
7.4.210.0070.01116.67
7.4.200.0030.00316.73
7.4.160.0060.01016.68
7.4.150.0070.01017.40
7.4.140.0130.00517.86
7.4.130.0070.01216.57
7.4.120.0090.01416.56
7.4.110.0080.01216.56
7.4.100.0120.00616.55
7.4.90.0090.01216.61
7.4.80.0150.00519.39
7.4.70.0060.01216.57
7.4.60.0070.01016.61
7.4.50.0050.00516.51
7.4.40.0080.00816.43
7.4.30.0130.00316.41
7.4.00.0060.00915.19
7.3.330.0000.00713.43
7.3.320.0000.00513.43
7.3.310.0000.00716.32
7.3.300.0040.00416.32
7.3.290.0070.00016.32
7.3.280.0070.01016.43
7.3.270.0040.01417.40
7.3.260.0130.00316.38
7.3.250.0100.00816.48
7.3.240.0100.01016.68
7.3.230.0090.00916.48
7.3.210.0060.01216.49
7.3.200.0100.00619.39
7.3.190.0070.01016.55
7.3.180.0030.01316.64
7.3.170.0180.00316.58
7.3.160.0130.00916.58
7.3.120.0120.00315.11
7.3.110.0100.00714.84
7.3.100.0030.01315.07
7.3.90.0060.00614.86
7.3.80.0080.00415.01
7.3.70.0090.00614.91
7.3.60.0030.01214.92
7.3.50.0040.00414.95
7.3.40.0060.00614.86
7.3.30.0000.00914.93
7.3.20.0060.00616.76
7.3.10.0060.00916.69
7.3.00.0060.01016.88
7.2.330.0130.00716.70
7.2.320.0000.01616.82
7.2.310.0110.01116.97
7.2.300.0110.01116.76
7.2.290.0070.01016.71
7.2.250.0060.01015.29
7.2.240.0110.00715.20
7.2.230.0110.00415.09
7.2.220.0040.00715.21
7.2.210.0130.00314.86
7.2.200.0090.00315.23
7.2.190.0060.00915.03
7.2.180.0070.01015.27
7.2.170.0100.00715.08
7.2.110.0100.00716.65
7.2.60.0040.01116.96
7.2.00.0040.01219.49
7.1.330.0080.00815.85
7.1.320.0100.00015.82
7.1.310.0070.01015.76
7.1.300.0000.01415.91
7.1.290.0100.00315.78
7.1.280.0070.00715.90
7.1.270.0060.00315.44
7.1.260.0000.00915.79
7.1.200.0000.01415.62
7.1.100.0000.01018.04
7.1.70.0000.00716.98
7.1.60.0130.01019.06
7.1.50.0120.00917.14
7.1.00.0030.07722.35
7.0.200.0130.00714.69
7.0.60.0070.07721.77
7.0.50.0000.08718.07
7.0.40.0030.08020.31
7.0.30.0270.08020.31
7.0.20.0270.07020.07
7.0.10.0070.04720.16
7.0.00.0070.05720.24
5.6.280.0000.03721.01
5.6.210.0130.08320.53
5.6.200.0070.06018.29
5.6.190.0100.03720.52
5.6.180.0270.04320.68
5.6.170.0200.05020.52
5.6.160.0100.06020.59
5.6.150.0070.08018.20
5.6.140.0030.08318.18
5.6.130.0030.05718.18
5.6.120.0100.07721.08
5.6.110.0030.06321.15
5.6.100.0100.08021.04
5.6.90.0100.08721.09
5.6.80.0070.03720.44
5.5.350.0070.08020.52
5.5.340.0030.06718.08
5.5.330.0170.06320.45
5.5.320.0630.06320.25
5.5.310.0130.04720.35
5.5.300.0130.04017.99
5.5.290.0000.08718.07
5.5.280.0130.07720.90
5.5.270.0000.05320.73
5.5.260.0030.07020.97
5.5.250.0100.08020.68
5.5.240.0230.07720.22

preferences:
41.99 ms | 400 KiB | 5 Q