3v4l.org

run code in 300+ PHP versions simultaneously
<?php #$dec = Decrypt("/TXRfo3Pfg8W47sFKRQYsO5ya6b4fAv9ef3Tt2JCro8=", "ICS2015", "7"); #echo "Dec: " . $dec . "\r\n"; $enc = Encrypt("boy519@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); $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) { $ciphertext = mb_convert_encoding($ciphertext,'UTF-16LE'); $key = PBKDF1($password, $salt, 100, 32); $iv = PBKDF1($password, $salt, 100, 16); $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $len = strlen($ciphertext); $padding = $block - ($len % $block); $ciphertext .= str_repeat(chr($padding),$padding); 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.0220.00016.88
8.3.50.0140.00921.32
8.3.40.0110.00418.59
8.3.30.0110.00418.71
8.3.20.0050.00320.21
8.3.10.0080.00023.53
8.3.00.0040.00423.61
8.2.180.0130.01018.65
8.2.170.0160.00319.12
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0130.00624.66
8.2.130.0120.00619.82
8.2.120.0000.00826.35
8.2.110.0100.01022.15
8.2.100.0080.00417.93
8.2.90.0040.00419.34
8.2.80.0000.00818.16
8.2.70.0000.00917.88
8.2.60.0040.00418.05
8.2.50.0030.00518.07
8.2.40.0040.00422.26
8.2.30.0040.00420.71
8.2.20.0000.00817.91
8.2.10.0000.00718.28
8.2.00.0000.00918.21
8.1.280.0180.00425.92
8.1.270.0000.01722.11
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0050.00523.93
8.1.230.0030.00719.12
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0060.00317.35
8.1.180.0030.00618.10
8.1.170.0000.00918.61
8.1.160.0040.00420.77
8.1.150.0040.00419.02
8.1.140.0030.00519.65
8.1.130.0000.00717.70
8.1.120.0040.00417.57
8.1.110.0040.00417.59
8.1.100.0000.00817.54
8.1.90.0040.00417.55
8.1.80.0000.00817.41
8.1.70.0040.00417.59
8.1.60.0000.00817.51
8.1.50.0040.00417.47
8.1.40.0040.00417.62
8.1.30.0040.00417.65
8.1.20.0000.00817.77
8.1.10.0050.00317.64
8.1.00.0000.00817.60
8.0.300.0000.00718.77
8.0.290.0080.00016.88
8.0.280.0070.00018.54
8.0.270.0030.00317.46
8.0.260.0030.00317.36
8.0.250.0040.00417.09
8.0.240.0030.00617.06
8.0.230.0000.00717.15
8.0.220.0040.00417.14
8.0.210.0040.00417.09
8.0.200.0000.00717.06
8.0.190.0030.00517.13
8.0.180.0030.00716.97
8.0.170.0050.00316.96
8.0.160.0040.00417.02
8.0.150.0040.00417.05
8.0.140.0000.00716.89
8.0.130.0060.00013.47
8.0.120.0000.00816.93
8.0.110.0040.00417.06
8.0.100.0040.00417.05
8.0.90.0030.00516.92
8.0.80.0040.01117.02
8.0.70.0070.00016.91
8.0.60.0080.00016.91
8.0.50.0030.00616.95
8.0.30.0120.00617.12
8.0.20.0090.01017.40
8.0.10.0000.00717.04
8.0.00.0100.00916.84
7.4.330.0000.00516.69
7.4.320.0000.00616.69
7.4.300.0030.00616.55
7.4.290.0030.00316.71
7.4.280.0030.00716.50
7.4.270.0070.00016.57
7.4.260.0070.00016.61
7.4.250.0070.00016.64
7.4.240.0040.00416.67
7.4.230.0070.00016.44
7.4.220.0070.01116.50
7.4.210.0070.01016.64
7.4.200.0030.00316.60
7.4.160.0070.01016.54
7.4.150.0150.00417.40
7.4.140.0110.00917.86
7.4.130.0050.01216.59
7.4.120.0100.00716.62
7.4.110.0060.01216.59
7.4.100.0110.00716.77
7.4.90.0060.01216.69
7.4.80.0060.01519.39
7.4.70.0130.00316.48
7.4.60.0100.00616.52
7.4.50.0080.00616.59
7.4.40.0110.01116.73
7.4.30.0060.01516.74
7.4.00.0040.01015.04
7.3.330.0060.00013.35
7.3.320.0000.00513.50
7.3.310.0000.00816.41
7.3.300.0070.00016.51
7.3.290.0030.00316.38
7.3.280.0080.01216.50
7.3.270.0100.01417.40
7.3.260.0100.00716.68
7.3.250.0090.00916.52
7.3.240.0080.01116.56
7.3.230.0030.01316.52
7.3.210.0070.01116.43
7.3.200.0170.00019.39
7.3.190.0090.00916.53
7.3.180.0110.00516.53
7.3.170.0140.01116.50
7.3.160.0100.00616.30
7.3.120.0030.01314.95
7.3.110.0120.00614.75
7.3.100.0030.01214.96
7.3.90.0100.00714.91
7.3.80.0060.01214.86
7.3.70.0000.01614.73
7.3.60.0080.00815.04
7.3.50.0120.00314.96
7.3.40.0060.01214.95
7.3.30.0030.01014.64
7.3.20.0030.00916.89
7.3.10.0050.00816.77
7.3.00.0000.01516.80
7.2.330.0120.00616.66
7.2.320.0160.00616.81
7.2.310.0100.01316.67
7.2.300.0090.00916.61
7.2.290.0030.01416.72
7.2.250.0060.01214.97
7.2.240.0030.01415.13
7.2.230.0100.01014.88
7.2.220.0060.00615.08
7.2.210.0060.01215.27
7.2.200.0060.00915.16
7.2.190.0070.01115.15
7.2.180.0070.01014.97
7.2.170.0040.00815.02
7.2.60.0110.00316.86
7.2.00.0030.00919.30
7.1.330.0090.00615.82
7.1.320.0070.00316.01
7.1.310.0030.01415.67
7.1.300.0000.01315.76
7.1.290.0090.00915.80
7.1.280.0040.00815.88
7.1.270.0140.00016.02
7.1.260.0030.01215.75
7.1.200.0040.00815.84
7.1.100.0030.00918.29
7.1.70.0030.00517.33
7.1.60.0090.01619.20
7.1.50.0120.00917.08
7.1.00.0000.08022.50
7.0.200.0160.00414.79
7.0.60.0070.07721.75
7.0.50.0170.06717.84
7.0.40.0100.08720.11
7.0.30.0300.05320.28
7.0.20.0130.04320.09
7.0.10.0070.04020.07
7.0.00.0100.03720.07
5.6.280.0070.03320.84
5.6.210.0100.07320.65
5.6.200.0130.07718.20
5.6.190.0030.08720.66
5.6.180.0370.07720.58
5.6.170.0400.05720.43
5.6.160.0070.09320.61
5.6.150.0130.08018.20
5.6.140.0130.07318.19
5.6.130.0100.07718.20
5.6.120.0200.07021.09
5.6.110.0030.04321.14
5.6.100.0070.07020.94
5.6.90.0070.07321.17
5.6.80.0070.07020.49
5.5.350.0300.06020.36
5.5.340.0070.04018.09
5.5.330.0100.08720.44
5.5.320.0530.05720.36
5.5.310.0170.04020.27
5.5.300.0000.08717.97
5.5.290.0030.06017.99
5.5.280.0100.07320.87
5.5.270.0030.04320.96
5.5.260.0070.04020.82
5.5.250.0170.08020.66
5.5.240.0030.03720.09

preferences:
46.2 ms | 401 KiB | 5 Q