3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "wpdPVWejqNRYqDTeUJ2Iw06/rnfHAoy5jtgTojiilD0="; $pwd = "ICS2015"; $salt = "7"; $dec = Decrypt($data, $pwd, $salt); echo "Dec: " . $dec . "\r\n"; $enc = Encrypt("boy10@naver.com", $pwd, $salt); 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) { $derived = PBKDF1($password, $salt, 100, 48); $key = bin2hex(substr($derived, 0, 32)); $iv = bin2hex(substr($derived, 32, 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.0030.01216.98
8.3.50.0090.00616.75
8.3.40.0090.00618.79
8.3.30.0090.00618.96
8.3.20.0030.00620.15
8.3.10.0080.00023.48
8.3.00.0060.00323.65
8.2.180.0160.00618.41
8.2.170.0120.00322.96
8.2.160.0100.00320.53
8.2.150.0030.00824.18
8.2.140.0030.00624.66
8.2.130.0060.00326.16
8.2.120.0080.00020.59
8.2.110.0070.00319.27
8.2.100.0090.00318.05
8.2.90.0080.00019.21
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0050.00318.05
8.2.50.0030.00618.07
8.2.40.0030.00522.33
8.2.30.0050.00320.71
8.2.20.0040.00417.85
8.2.10.0000.00818.18
8.2.00.0000.00918.16
8.1.280.0060.01225.92
8.1.270.0080.00022.22
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00317.38
8.1.230.0040.00719.32
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0050.00517.48
8.1.190.0040.00417.38
8.1.180.0000.00818.10
8.1.170.0050.00318.78
8.1.160.0040.00420.70
8.1.150.0050.00319.02
8.1.140.0060.00319.55
8.1.130.0030.00317.70
8.1.120.0050.00317.54
8.1.110.0040.00417.43
8.1.100.0030.00517.52
8.1.90.0030.00517.51
8.1.80.0030.00617.55
8.1.70.0070.00017.39
8.1.60.0030.00617.61
8.1.50.0040.00417.53
8.1.40.0040.00417.64
8.1.30.0040.00417.56
8.1.20.0030.00517.72
8.1.10.0030.00517.54
8.1.00.0090.00017.57
8.0.300.0080.00018.77
8.0.290.0040.00416.73
8.0.280.0070.00018.46
8.0.270.0030.00517.28
8.0.260.0030.00317.28
8.0.250.0070.00016.97
8.0.240.0040.00417.11
8.0.230.0000.00717.05
8.0.220.0080.00017.07
8.0.210.0070.00017.02
8.0.200.0070.00017.10
8.0.190.0070.00016.95
8.0.180.0000.00817.04
8.0.170.0040.00417.03
8.0.160.0070.00017.02
8.0.150.0070.00016.87
8.0.140.0040.00416.88
8.0.130.0050.00013.51
8.0.120.0090.00016.95
8.0.110.0080.00016.97
8.0.100.0000.00716.89
8.0.90.0070.00016.86
8.0.80.0030.01316.98
8.0.70.0040.00416.90
8.0.60.0050.00316.88
8.0.50.0030.00516.96
8.0.30.0050.01517.16
8.0.20.0120.00617.40
8.0.10.0040.00416.96
8.0.00.0090.01016.84
7.4.330.0000.00516.66
7.4.320.0000.00616.46
7.4.300.0030.00316.57
7.4.290.0070.00016.67
7.4.280.0080.00316.55
7.4.270.0070.00016.52
7.4.260.0060.00316.46
7.4.250.0000.00716.50
7.4.240.0020.00516.53
7.4.230.0070.00016.75
7.4.220.0110.00716.52
7.4.210.0110.00716.64
7.4.200.0070.00016.74
7.4.160.0140.01016.48
7.4.150.0160.00317.40
7.4.140.0170.00317.86
7.4.130.0140.01516.65
7.4.120.0040.01416.58
7.4.110.0100.00716.56
7.4.100.0030.01716.52
7.4.90.0110.00616.65
7.4.80.0030.01619.39
7.4.70.0080.00916.58
7.4.60.0120.00616.66
7.4.50.0070.00716.46
7.4.40.0030.01416.58
7.4.30.0130.00316.54
7.4.10.0030.01716.36
7.4.00.0040.01215.65
7.3.330.0050.00013.44
7.3.320.0000.00513.49
7.3.310.0040.00416.58
7.3.300.0070.00016.44
7.3.290.0030.00316.50
7.3.280.0080.01216.48
7.3.270.0120.00817.40
7.3.260.0100.00716.39
7.3.250.0070.01216.54
7.3.240.0100.01016.55
7.3.230.0100.01016.62
7.3.210.0100.00716.43
7.3.200.0090.01216.52
7.3.190.0130.00316.36
7.3.180.0090.00616.49
7.3.170.0060.00916.54
7.3.160.0160.00916.41
7.3.130.0130.00316.54
7.3.120.0100.00316.42
7.3.110.0070.00716.43
7.3.100.0070.01016.60
7.3.90.0040.00916.45
7.3.80.0000.01716.72
7.3.70.0070.01116.49
7.3.60.0030.01416.39
7.3.50.0140.00016.50
7.3.40.0090.00316.39
7.3.30.0040.00716.27
7.3.20.0070.00718.16
7.3.10.0040.00818.23
7.3.00.0000.01218.25
7.2.330.0030.01416.68
7.2.320.0070.01016.88
7.2.310.0090.00916.77
7.2.300.0060.01116.69
7.2.290.0140.00316.63
7.2.260.0120.00616.89
7.2.250.0110.00916.44
7.2.240.0070.00716.52
7.2.230.0070.01016.81
7.2.220.0000.01616.90
7.2.210.0070.01016.63
7.2.200.0030.01516.77
7.2.190.0080.00816.54
7.2.180.0100.00616.63
7.2.170.0100.00516.76
7.2.160.0000.01916.39
7.2.150.0030.00918.49
7.2.140.0070.00718.37
7.2.130.0060.00918.40
7.2.120.0120.00318.41
7.2.110.0120.00417.55
7.2.100.0100.01018.44
7.2.90.0060.01018.53
7.2.80.0040.00718.35
7.2.70.0070.00718.41
7.2.60.0050.01017.50
7.2.50.0160.00018.21
7.2.40.0040.01518.31
7.2.30.0000.01718.41
7.2.20.0030.01018.34
7.2.10.0130.00718.26
7.2.00.0060.00818.92
7.1.330.0040.01417.43
7.1.320.0040.01117.43
7.1.310.0090.00317.37
7.1.300.0070.00717.38
7.1.290.0040.01217.26
7.1.280.0080.00817.30
7.1.270.0000.01317.39
7.1.260.0000.01317.41
7.1.250.0140.00317.28
7.1.240.0030.01417.37
7.1.230.0000.01317.30
7.1.220.0030.01217.48
7.1.210.0000.01317.21
7.1.200.0020.01216.57
7.1.190.0030.00617.28
7.1.180.0040.01117.24
7.1.170.0120.00317.30
7.1.160.0060.00317.28
7.1.150.0030.01317.11
7.1.140.0030.00617.46
7.1.130.0100.00717.18
7.1.120.0060.00617.20
7.1.110.0060.00917.35
7.1.100.0100.00717.70
7.1.90.0030.01417.27
7.1.80.0060.00617.39
7.1.70.0030.00917.33
7.1.60.0060.01318.20
7.1.50.0050.01217.19
7.1.40.0120.00017.47
7.1.30.0070.01017.36
7.1.20.0030.01417.51
7.1.10.0070.01117.39
7.1.00.0050.04319.92
7.0.330.0070.00716.86
7.0.320.0030.00717.07
7.0.310.0080.00417.25
7.0.300.0110.00316.82
7.0.290.0030.00717.06
7.0.280.0070.00717.16
7.0.270.0030.00716.98
7.0.260.0070.00716.65
7.0.250.0120.00417.25
7.0.240.0060.00617.29
7.0.230.0030.00617.09
7.0.220.0060.00617.10
7.0.210.0140.00317.18
7.0.200.0150.00316.00
7.0.190.0040.00816.93
7.0.180.0090.00316.87
7.0.170.0060.00617.16
7.0.160.0100.00716.96
7.0.150.0070.00317.00
7.0.140.0070.00316.89
7.0.130.0030.01017.05
7.0.120.0030.01316.96
7.0.110.0030.01117.05
7.0.100.0100.00317.06
7.0.90.0040.01117.07
7.0.80.0080.00817.04
7.0.70.0100.00317.09
7.0.60.0130.02018.53
7.0.50.0120.03817.48
7.0.40.0050.04617.40
7.0.30.0190.03017.59
7.0.20.0180.04017.73
7.0.10.0050.04017.55
7.0.00.0080.04117.51
5.6.400.0000.01215.98
5.6.390.0100.01015.79
5.6.380.0040.00715.99
5.6.370.0060.00615.68
5.6.360.0060.01315.88
5.6.350.0000.01615.72
5.6.340.0040.01215.61
5.6.330.0030.01716.04
5.6.320.0150.00015.75
5.6.310.0070.01115.71
5.6.300.0090.00615.86
5.6.290.0030.01016.06
5.6.280.0050.02418.54
5.6.270.0100.00715.96
5.6.260.0080.00815.92
5.6.250.0050.00915.84
5.6.240.0050.01415.71
5.6.230.0060.00916.09
5.6.220.0060.00615.83
5.6.210.0050.05018.29
5.6.200.0100.04216.91
5.6.190.0060.02518.15
5.6.180.0130.02518.26
5.6.170.0250.02318.21
5.6.160.0100.04218.29
5.6.150.0100.04117.16
5.6.140.0100.03017.02
5.6.130.0100.02317.20
5.6.120.0050.03418.41
5.6.110.0080.03218.47
5.6.100.0110.03618.56
5.6.90.0050.04018.59
5.6.80.0040.02618.20
5.6.70.0060.01016.05
5.6.60.0000.01415.96
5.6.50.0090.00615.69
5.6.40.0100.00715.61
5.6.30.0000.01816.03
5.6.20.0130.00315.93
5.6.10.0040.01116.04
5.6.00.0160.00016.08
5.5.380.0150.00315.75
5.5.370.0070.00715.91
5.5.360.0000.01415.97
5.5.350.0080.04618.12
5.5.340.0080.04016.91
5.5.330.0050.04718.05
5.5.320.0370.03818.10
5.5.310.0080.02717.95
5.5.300.0080.03216.91
5.5.290.0080.04516.96
5.5.280.0060.03318.47
5.5.270.0100.04018.48
5.5.260.0090.04718.49
5.5.250.0050.04418.34
5.5.240.0150.03118.14
5.5.230.0060.00615.78
5.5.220.0070.00715.63
5.5.210.0000.01115.85
5.5.200.0070.01015.93
5.5.190.0060.00615.59
5.5.180.0100.00015.78
5.5.170.0040.00815.82
5.5.160.0040.01215.80
5.5.150.0030.00915.90
5.5.140.0030.01015.95
5.5.130.0070.00715.85
5.5.120.0100.00015.97
5.5.110.0030.01015.76
5.5.100.0110.00715.71
5.5.90.0070.01115.67
5.5.80.0060.00615.87
5.5.70.0000.01115.82
5.5.60.0090.00615.77
5.5.50.0080.00315.77
5.5.40.0060.00915.54
5.5.30.0100.00015.90
5.5.20.0030.01015.57
5.5.10.0120.00315.59
5.5.00.0000.01615.88

preferences:
43.08 ms | 401 KiB | 5 Q