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) { $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,$dklen) { $t = $pass.$salt; //echo 'S||P: '.bin2hex($t).'<br/>'; $t = sha1($t, true); //echo 'T1:' . bin2hex($t) . '<br/>'; for($i=2; $i <= $count; $i++) { $t = sha1($t, true); //echo 'T'.$i.':' . bin2hex($t) . '<br/>'; } $t = substr($t,0,$dklen); return $t; } ?>

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.0160.00616.47
8.3.50.0210.01521.20
8.3.40.0140.00718.86
8.3.30.0090.00618.70
8.3.20.0000.00720.34
8.3.10.0000.00823.47
8.3.00.0080.00023.62
8.2.180.0030.01318.29
8.2.170.0060.01318.79
8.2.160.0090.00622.96
8.2.150.0050.00524.18
8.2.140.0080.00024.66
8.2.130.0070.00317.91
8.2.120.0080.00026.35
8.2.110.0130.00322.13
8.2.100.0110.00017.93
8.2.90.0040.00719.27
8.2.80.0060.00318.16
8.2.70.0040.00417.63
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0040.00422.32
8.2.30.0050.00220.52
8.2.20.0040.00417.82
8.2.10.0050.00318.21
8.2.00.0020.00518.20
8.1.280.0110.00325.92
8.1.270.0060.00321.88
8.1.260.0030.00528.09
8.1.250.0000.00728.09
8.1.240.0040.00423.92
8.1.230.0110.00019.00
8.1.220.0080.00017.76
8.1.210.0040.00418.77
8.1.200.0060.00317.22
8.1.190.0040.00417.38
8.1.180.0000.00818.10
8.1.170.0000.00818.47
8.1.160.0000.00720.70
8.1.150.0040.00418.76
8.1.140.0060.00319.45
8.1.130.0050.00317.70
8.1.120.0050.00317.39
8.1.110.0050.00317.31
8.1.100.0040.00417.44
8.1.90.0020.00517.37
8.1.80.0060.00317.31
8.1.70.0040.00417.39
8.1.60.0040.00417.61
8.1.50.0000.00917.50
8.1.40.0000.00817.52
8.1.30.0000.00817.64
8.1.20.0030.00617.60
8.1.10.0040.00417.63
8.1.00.0080.00017.52
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0000.00718.46
8.0.270.0040.00417.29
8.0.260.0030.00317.28
8.0.250.0040.00416.93
8.0.240.0040.00417.04
8.0.230.0000.00717.03
8.0.220.0040.00416.99
8.0.210.0040.00416.86
8.0.200.0030.00316.92
8.0.190.0000.00717.01
8.0.180.0000.00717.00
8.0.170.0040.00416.98
8.0.160.0000.00916.94
8.0.150.0030.00516.90
8.0.140.0040.00416.88
8.0.130.0000.00613.38
8.0.120.0090.00016.95
8.0.110.0080.00016.95
8.0.100.0050.00216.91
8.0.90.0070.00016.80
8.0.80.0030.01317.02
8.0.70.0080.00016.81
8.0.60.0000.00816.95
8.0.50.0040.00416.85
8.0.30.0070.01217.06
8.0.20.0080.01117.40
8.0.10.0000.00717.09
8.0.00.0110.00816.70
7.4.330.0050.00016.80
7.4.320.0030.00316.32
7.4.300.0030.00316.64
7.4.290.0080.00016.61
7.4.280.0030.00716.50
7.4.270.0030.00316.38
7.4.260.0000.00716.51
7.4.250.0020.00516.59
7.4.240.0060.00116.44
7.4.230.0030.00316.43
7.4.220.0110.01716.66
7.4.210.0130.00616.62
7.4.200.0030.00316.61
7.4.160.0090.00616.33
7.4.150.0120.00617.40
7.4.140.0050.01517.86
7.4.130.0120.00816.58
7.4.120.0110.00716.55
7.4.110.0060.01216.63
7.4.100.0110.01116.60
7.4.90.0120.00916.59
7.4.80.0150.00319.39
7.4.70.0040.01316.61
7.4.60.0130.00316.63
7.4.50.0030.00816.60
7.4.40.0130.00316.55
7.4.30.0030.01416.45
7.4.00.0070.00315.05
7.3.330.0000.00613.23
7.3.320.0000.00613.34
7.3.310.0020.00516.37
7.3.300.0030.00316.33
7.3.290.0000.00716.30
7.3.280.0100.00616.34
7.3.270.0030.01317.40
7.3.260.0100.00716.57
7.3.250.0080.01316.53
7.3.240.0110.00816.53
7.3.230.0090.00916.41
7.3.210.0170.00016.39
7.3.200.0130.00319.39
7.3.190.0090.00916.54
7.3.180.0100.00616.30
7.3.170.0090.01316.37
7.3.160.0110.01116.47
7.3.10.0120.00416.57
7.3.00.0060.00616.49
7.2.330.0060.01316.59
7.2.320.0090.00816.84
7.2.310.0090.00916.62
7.2.300.0210.02116.71
7.2.290.0070.01016.52
7.2.130.0070.00916.81
7.2.120.0100.00516.76
7.2.110.0070.00916.74
7.2.100.0020.01416.74
7.2.90.0120.00416.68
7.2.80.0070.00716.87
7.2.70.0100.00516.84
7.2.60.0070.00716.73
7.2.50.0080.00716.62
7.2.40.0100.00716.95
7.2.30.0070.00816.86
7.2.20.0090.00516.72
7.2.10.0030.01016.75
7.2.00.0140.00317.82
7.1.250.0110.00515.58
7.1.200.0000.01115.77
7.1.100.0030.01418.31
7.1.70.0080.00017.28
7.1.60.0000.01117.25
7.1.50.0000.01116.85
7.1.40.0070.00716.68
7.1.30.0040.00816.58
7.1.20.0040.00816.64
7.1.10.0100.00716.79
7.1.00.0000.00916.67
7.0.200.0030.00716.86
7.0.190.0000.01016.70
7.0.180.0000.01116.49
7.0.170.0040.01416.49
7.0.160.0050.00216.49
7.0.150.0030.00616.49
7.0.140.0030.00516.49
7.0.130.0030.00916.74
7.0.120.0040.00416.77
7.0.110.0000.01116.49
7.0.100.0040.00816.66
7.0.90.0050.00516.49
7.0.80.0000.00816.51
7.0.70.0000.00816.53
7.0.60.0000.00816.49
7.0.50.0040.00716.68
7.0.40.0030.00516.49
7.0.30.0000.00716.49
7.0.20.0050.00216.49
7.0.10.0050.00216.49
7.0.00.0050.00316.49
5.6.300.0060.03820.83
5.6.290.0070.04120.86
5.6.280.0030.04620.88
5.6.270.0070.06321.02
5.6.260.0030.08120.87
5.6.250.0100.05220.98
5.6.240.0070.05120.83
5.6.230.0000.04720.82
5.6.220.0030.05020.91
5.6.210.0030.04121.05
5.6.200.0070.04320.95
5.6.190.0030.04320.82
5.6.180.0000.04620.96
5.6.170.0070.04020.94
5.6.160.0030.05120.94
5.6.150.0000.06620.69
5.6.140.0030.04120.77
5.6.130.0000.04421.05
5.6.120.0130.03820.85
5.6.110.0160.03520.88
5.6.100.0030.05020.92
5.6.90.0060.03921.02
5.6.80.0000.04120.32
5.6.70.0070.04020.31
5.6.60.0130.04920.23
5.6.50.0000.04420.44
5.6.40.0000.04020.14
5.6.30.0100.04220.32
5.6.20.0030.05220.28
5.6.10.0100.03720.38
5.6.00.0030.04120.27
5.5.380.0030.07817.39
5.5.370.0030.04117.38
5.5.360.0060.03917.64
5.5.350.0030.03817.48
5.5.340.0030.06818.19
5.5.330.0260.04217.97
5.5.320.0030.04118.03
5.5.310.0100.03518.03
5.5.300.0000.06218.03
5.5.290.0070.04017.95
5.5.280.0000.04718.09
5.5.270.0000.04518.02
5.5.260.0070.03617.68
5.5.250.0030.03917.94
5.5.240.0000.04117.48
5.5.230.0000.04017.50
5.5.220.0030.04817.36
5.5.210.0070.03617.09
5.5.200.0000.04017.40
5.5.190.0030.05217.45
5.5.180.0070.04217.38
5.5.160.0030.04117.38
5.5.150.0030.03617.50
5.5.140.0030.06317.48
5.5.130.0070.04017.48
5.5.120.0070.04317.29
5.5.110.0100.03617.38
5.5.100.0100.03717.37
5.5.90.0070.03316.96
5.5.80.0070.06317.22
5.5.70.0070.06017.13
5.5.60.0000.04117.13
5.5.50.0000.04216.93
5.5.40.0000.04217.37
5.5.30.0030.03917.28
5.5.20.0100.03517.21
5.5.10.0030.04317.35
5.5.00.0000.04417.36

preferences:
32.59 ms | 401 KiB | 5 Q