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_encode($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.4.20.0070.01318.43
8.4.10.0030.00619.80
8.3.150.0030.01617.35
8.3.140.0140.00416.91
8.3.130.0100.00018.50
8.3.120.0040.00418.98
8.3.110.0150.00416.76
8.3.100.0000.01024.06
8.3.90.0070.00726.77
8.3.80.0090.00017.97
8.3.70.0090.00616.63
8.3.60.0030.01318.55
8.3.50.0110.00822.09
8.3.40.0090.00618.75
8.3.30.0080.00818.79
8.3.20.0080.00019.86
8.3.10.0050.00322.04
8.3.00.0040.00423.52
8.2.270.0070.01117.10
8.2.260.0080.00019.09
8.2.250.0080.00018.32
8.2.240.0100.00717.36
8.2.230.0000.00820.94
8.2.220.0060.00337.54
8.2.210.0050.00326.77
8.2.200.0060.00316.63
8.2.190.0030.01316.75
8.2.180.0280.00016.63
8.2.170.0040.01122.96
8.2.160.0140.00420.33
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00820.91
8.2.110.0030.00621.12
8.2.100.0090.00317.91
8.2.90.0040.00418.16
8.2.80.0050.00320.36
8.2.70.0060.00317.63
8.2.60.0050.00318.03
8.2.50.0080.00021.06
8.2.40.0000.00820.49
8.2.30.0050.00220.51
8.2.20.0040.00418.16
8.2.10.0000.00718.06
8.2.00.0040.00418.29
8.1.310.0080.00016.74
8.1.300.0090.00018.66
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0050.00324.66
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0100.00020.88
8.1.230.0130.00420.91
8.1.220.0030.00517.78
8.1.210.0050.00318.96
8.1.200.0060.00317.38
8.1.190.0000.00817.23
8.1.180.0060.00318.10
8.1.170.0000.00818.49
8.1.160.0080.00018.76
8.1.150.0070.00020.29
8.1.140.0070.00019.44
8.1.130.0000.00719.04
8.1.120.0050.00317.41
8.1.110.0000.00717.37
8.1.100.0000.00717.32
8.1.90.0040.00417.26
8.1.80.0060.00317.36
8.1.70.0000.00717.46
8.1.60.0050.00317.48
8.1.50.0040.00417.52
8.1.40.0040.00417.54
8.1.30.0050.00317.51
8.1.20.0040.00417.57
8.1.10.0050.00317.52
8.1.00.0060.00317.59
8.0.300.0040.00420.10
8.0.290.0000.00716.75
8.0.280.0000.00718.51
8.0.270.0030.00317.31
8.0.260.0030.00317.23
8.0.250.0030.00316.93
8.0.240.0030.00516.97
8.0.230.0000.00717.04
8.0.220.0030.00316.96
8.0.210.0040.00416.86
8.0.200.0030.00316.90
8.0.190.0040.00716.96
8.0.180.0030.00516.88
8.0.170.0090.00016.85
8.0.160.0040.00417.00
8.0.150.0040.00416.95
8.0.140.0000.00716.93
8.0.130.0060.00013.40
8.0.120.0080.00016.89
8.0.110.0040.00416.88
8.0.100.0040.00416.92
8.0.90.0040.00416.88
8.0.80.0100.00716.93
8.0.70.0030.00516.86
8.0.60.0000.00817.01
8.0.50.0000.00716.84
8.0.30.0100.01017.20
8.0.20.0090.01117.40
8.0.10.0050.00316.90
8.0.00.0070.01116.80
7.4.330.0050.00015.55
7.4.320.0030.00316.37
7.4.300.0000.00616.63
7.4.290.0000.00716.52
7.4.280.0000.00916.43
7.4.270.0080.00016.48
7.4.260.0000.00916.52
7.4.250.0050.00316.44
7.4.240.0000.00716.63
7.4.230.0070.00016.46
7.4.220.0070.01116.69
7.4.210.0070.01116.57
7.4.200.0040.00416.71
7.4.160.0080.00816.32
7.4.150.0150.00917.40
7.4.140.0120.00717.86
7.4.130.0100.01316.53
7.4.120.0100.01016.60
7.4.110.0150.00916.64
7.4.100.0120.00616.52
7.4.90.0100.01316.59
7.4.80.0150.00619.39
7.4.70.0060.01116.37
7.4.60.0100.00616.49
7.4.50.0000.01416.63
7.4.40.0150.00316.56
7.4.30.0110.00516.56
7.4.00.0060.00914.87
7.3.330.0000.00613.34
7.3.320.0030.00313.46
7.3.310.0030.00316.32
7.3.300.0060.00016.36
7.3.290.0000.00716.30
7.3.280.0100.01016.34
7.3.270.0040.01417.40
7.3.260.0140.01016.39
7.3.250.0070.01016.52
7.3.240.0100.01016.50
7.3.230.0110.00716.37
7.3.210.0070.01016.43
7.3.200.0130.00316.52
7.3.190.0000.01816.45
7.3.180.0140.00316.32
7.3.170.0030.01516.66
7.3.160.0060.01016.37
7.2.330.0090.00916.91
7.2.320.0060.01116.56
7.2.310.0060.01716.73
7.2.300.0060.01216.66
7.2.290.0040.01316.80
7.2.60.0040.00717.02
7.2.00.0000.01319.37
7.1.200.0030.00615.63
7.1.100.0030.01217.98
7.1.70.0000.01717.29
7.1.60.0050.00517.34
7.1.50.0100.01417.05
7.1.20.0330.07040.14
7.1.10.0200.05722.02
7.1.00.0000.06322.27
7.0.200.0070.01016.74
7.0.160.0070.05721.84
7.0.150.0030.07021.82
7.0.140.0100.06321.77
7.0.130.0030.06321.86
7.0.120.0130.06321.77
7.0.110.0100.05721.85
7.0.100.0030.06021.82
7.0.90.0030.06021.93
7.0.80.0070.05721.77
7.0.70.0070.05321.84
7.0.60.0030.06021.69
7.0.50.0030.06321.95
7.0.40.0070.05721.71
7.0.30.0170.05321.89
7.0.20.0030.05721.78
7.0.10.0100.06321.83
7.0.00.0100.05321.89

preferences:
64.31 ms | 403 KiB | 5 Q