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, 1000, 32); echo "key: " . base64_decode($key) . "\r\n"; $iv = PBKDF1($password, $salt, 1000, 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.0150.00018.43
8.3.50.0080.00818.02
8.3.40.0120.00318.91
8.3.30.0110.00718.84
8.3.20.0040.00419.73
8.3.10.0080.00021.92
8.3.00.0080.00023.48
8.2.180.0160.00318.54
8.2.170.0120.00322.96
8.2.160.0150.00320.42
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00020.41
8.2.120.0040.00426.35
8.2.110.0060.00320.94
8.2.100.0090.00317.77
8.2.90.0040.00419.28
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0080.00017.93
8.2.50.0060.00319.39
8.2.40.0020.00520.45
8.2.30.0040.00420.34
8.2.20.0000.00818.09
8.2.10.0060.00318.04
8.2.00.0000.00718.14
8.1.280.0100.01325.92
8.1.270.0090.00923.88
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0000.01019.12
8.1.230.0110.00017.77
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0000.00818.76
8.1.150.0000.00720.32
8.1.140.0040.00419.56
8.1.130.0080.00019.04
8.1.120.0030.00517.38
8.1.110.0000.00717.31
8.1.100.0000.00717.38
8.1.90.0020.00517.42
8.1.80.0000.00817.42
8.1.70.0030.00317.25
8.1.60.0090.00017.59
8.1.50.0000.00817.52
8.1.40.0040.00417.52
8.1.30.0030.00517.67
8.1.20.0000.00717.60
8.1.10.0050.00317.55
8.1.00.0040.00417.54
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0000.00818.47
8.0.270.0000.00717.15
8.0.260.0070.00017.33
8.0.250.0030.00317.06
8.0.240.0080.00016.92
8.0.230.0030.00316.95
8.0.220.0070.00016.91
8.0.210.0000.00716.84
8.0.200.0030.00317.01
8.0.190.0100.00016.94
8.0.180.0000.00816.98
8.0.170.0060.00617.02
8.0.160.0040.00417.06
8.0.150.0040.00416.88
8.0.140.0050.00216.91
8.0.130.0000.00613.45
8.0.120.0000.00816.96
8.0.110.0040.00416.96
8.0.100.0040.00417.02
8.0.90.0080.00017.02
8.0.80.0030.01516.98
8.0.70.0040.00416.79
8.0.60.0070.00017.02
8.0.50.0020.00517.01
8.0.30.0090.01017.29
8.0.20.0090.01217.41
8.0.10.0040.00416.95
8.0.00.0070.01016.60
7.4.330.0000.00515.55
7.4.320.0000.00716.42
7.4.300.0060.00016.63
7.4.290.0060.00316.56
7.4.280.0000.00816.61
7.4.270.0070.00016.54
7.4.260.0030.00616.43
7.4.250.0070.00016.48
7.4.240.0000.00716.51
7.4.230.0080.00016.69
7.4.220.0120.00616.52
7.4.210.0030.01316.52
7.4.200.0000.00716.68
7.4.160.0100.00716.59
7.4.150.0070.01117.40
7.4.140.0070.01417.86
7.4.130.0120.00616.59
7.4.120.0040.01416.52
7.4.110.0110.00616.56
7.4.100.0140.00416.50
7.4.90.0030.01516.40
7.4.80.0030.01319.39
7.4.70.0130.00316.64
7.4.60.0000.01616.63
7.4.50.0090.00616.45
7.4.40.0130.00416.31
7.4.30.0100.00716.60
7.4.00.0080.00414.97
7.3.330.0000.00613.24
7.3.320.0000.00513.25
7.3.310.0000.00716.37
7.3.300.0000.00616.35
7.3.290.0030.00416.22
7.3.280.0110.00916.39
7.3.270.0100.00717.40
7.3.260.0090.01116.51
7.3.250.0090.00816.40
7.3.240.0100.00916.50
7.3.230.0130.00316.52
7.3.210.0090.00616.55
7.3.200.0110.00516.57
7.3.190.0110.00716.35
7.3.180.0110.00516.36
7.3.170.0130.00316.52
7.3.160.0060.01016.63
7.2.330.0130.00416.87
7.2.320.0060.01116.78
7.2.310.0060.01616.68
7.2.300.0040.01416.61
7.2.290.0070.01116.49
7.2.60.0030.01016.98
7.2.00.0100.00319.41
7.1.200.0050.00615.67
7.1.100.0000.01218.14
7.1.70.0030.01017.16
7.1.60.0060.00617.31
7.1.50.0140.01116.95
7.1.20.0830.05738.49
7.1.10.0800.06020.37
7.1.00.0270.06022.27
7.0.200.0030.01316.70
7.0.160.0700.05020.03
7.0.150.0130.06020.15
7.0.140.0100.06021.90
7.0.130.0870.06319.95
7.0.120.0730.06320.07
7.0.110.0670.06019.93
7.0.100.0030.06721.77
7.0.90.0130.07021.71
7.0.80.0030.07321.86
7.0.70.0100.05721.84
7.0.60.0030.07321.86
7.0.50.0000.06021.89
7.0.40.0170.05321.79
7.0.30.0100.05321.98
7.0.20.0130.06021.80
7.0.10.0130.05721.88
7.0.00.0130.05721.71

preferences:
36.51 ms | 400 KiB | 5 Q