3v4l.org

run code in 300+ PHP versions simultaneously
<?php #$dec = Decrypt("/TXRfo3Pfg8W47sFKRQYsO5ya6b4fAv9ef3Tt2JCro8=", "ICS2015", "7"); #echo "Dec: " . $dec . "\r\n"; $enc = Encrypt("boy520@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.0140.00716.75
8.3.50.0140.00716.61
8.3.40.0150.00318.88
8.3.30.0070.00718.70
8.3.20.0080.00020.41
8.3.10.0000.01423.66
8.3.00.0030.00623.40
8.2.180.0090.00618.66
8.2.170.0040.01119.16
8.2.160.0060.00922.96
8.2.150.0000.00724.18
8.2.140.0130.00624.66
8.2.130.0030.01619.82
8.2.120.0050.00326.35
8.2.110.0070.00322.26
8.2.100.0040.00718.02
8.2.90.0040.00419.22
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0030.00622.33
8.2.30.0020.00520.54
8.2.20.0040.00417.91
8.2.10.0040.00418.27
8.2.00.0000.00718.31
8.1.280.0110.00725.92
8.1.270.0040.00422.19
8.1.260.0060.00328.09
8.1.250.0090.00028.09
8.1.240.0060.00323.92
8.1.230.0040.00719.01
8.1.220.0000.00817.76
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0060.00318.70
8.1.160.0050.00220.88
8.1.150.0000.00719.09
8.1.140.0000.00919.71
8.1.130.0000.00717.81
8.1.120.0000.00717.49
8.1.110.0040.00417.45
8.1.100.0000.00717.45
8.1.90.0040.00417.55
8.1.80.0030.00617.56
8.1.70.0000.00717.58
8.1.60.0040.00417.68
8.1.50.0060.00317.53
8.1.40.0030.00617.59
8.1.30.0000.00817.65
8.1.20.0000.00717.76
8.1.10.0000.00917.63
8.1.00.0030.00617.49
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0040.00418.48
8.0.270.0000.00717.29
8.0.260.0030.00317.23
8.0.250.0050.00217.00
8.0.240.0080.00017.02
8.0.230.0070.00017.00
8.0.220.0040.00417.06
8.0.210.0030.00617.02
8.0.200.0000.00817.02
8.0.190.0040.00417.12
8.0.180.0070.00317.02
8.0.170.0030.00517.07
8.0.160.0030.00317.01
8.0.150.0050.00317.00
8.0.140.0040.00417.02
8.0.130.0050.00013.41
8.0.120.0050.00317.00
8.0.110.0000.00916.97
8.0.100.0000.00717.07
8.0.90.0040.00416.85
8.0.80.0100.00717.09
8.0.70.0050.00317.04
8.0.60.0050.00317.11
8.0.50.0080.00016.89
8.0.30.0120.00717.13
8.0.20.0100.00917.40
8.0.10.0040.00417.00
8.0.00.0130.00816.86
7.4.330.0050.00016.67
7.4.320.0030.00316.63
7.4.300.0060.00316.71
7.4.290.0030.00316.60
7.4.280.0050.00516.69
7.4.270.0000.00716.59
7.4.260.0030.00316.57
7.4.250.0060.00316.63
7.4.240.0040.00416.65
7.4.230.0000.00816.78
7.4.220.0080.01216.73
7.4.210.0080.00916.63
7.4.200.0030.00316.80
7.4.160.0080.00816.57
7.4.150.0060.01217.40
7.4.140.0110.00917.86
7.4.130.0080.01016.58
7.4.120.0090.00816.61
7.4.110.0070.01016.69
7.4.100.0060.01216.68
7.4.90.0140.00716.68
7.4.80.0090.00919.39
7.4.70.0060.01216.64
7.4.60.0130.00316.70
7.4.50.0070.00716.55
7.4.40.0080.00816.48
7.4.30.0100.00716.77
7.4.00.0050.00815.06
7.3.330.0000.00613.49
7.3.320.0000.00613.32
7.3.310.0040.00416.36
7.3.300.0000.00716.32
7.3.290.0000.00716.56
7.3.280.0090.01016.52
7.3.270.0120.00617.40
7.3.260.0070.01016.45
7.3.250.0110.00816.53
7.3.240.0080.01116.51
7.3.230.0080.00916.55
7.3.210.0100.01016.47
7.3.200.0070.01016.68
7.3.190.0090.01216.59
7.3.180.0030.01316.54
7.3.170.0120.01316.53
7.3.160.0060.01616.48
7.2.330.0190.00716.93
7.2.320.0150.00716.64
7.2.310.0070.01016.72
7.2.300.0030.01416.71
7.2.290.0080.00816.72
7.2.60.0060.00916.86
7.2.00.0000.01319.54
7.1.200.0060.00315.62
7.1.100.0070.00417.84
7.1.70.0030.00717.29
7.1.60.0100.01619.20
7.1.50.0030.01917.06
7.1.00.0000.08022.57
7.0.200.0200.00314.65
7.0.100.0270.06720.01
7.0.90.0370.08319.95
7.0.80.0400.08020.20
7.0.70.0230.09020.00
7.0.60.0300.07019.95
7.0.50.0130.07720.47
7.0.40.0130.07720.13
7.0.30.0030.09320.22
7.0.20.0000.09020.12
7.0.10.0000.08320.22
7.0.00.0100.07320.13
5.6.250.0130.06320.52
5.6.240.0100.07720.76
5.6.230.0030.05320.63
5.6.220.0130.07320.73
5.6.210.0070.03720.77
5.6.200.0070.05721.11
5.6.190.0030.05721.23
5.6.180.0130.08021.24
5.6.170.0130.08321.11
5.6.160.0200.07021.16
5.6.150.0130.06721.23
5.6.140.0100.06721.09
5.6.130.0070.07021.21
5.6.120.0030.08021.20
5.6.110.0100.05721.18
5.6.100.0070.08721.09
5.6.90.0100.08021.09
5.6.80.0030.06320.57
5.6.70.0100.07020.61
5.6.60.0030.05720.50
5.6.50.0130.07720.45
5.6.40.0100.07320.55
5.6.30.0030.08320.56
5.6.20.0070.04720.53
5.6.10.0100.03320.45
5.6.00.0030.04020.43
5.5.380.0130.04020.48
5.5.370.0070.07720.38
5.5.360.0100.08320.43
5.5.350.0070.07720.50
5.5.340.0130.07720.69
5.5.330.0000.09320.87
5.5.320.0030.09020.93
5.5.310.0100.08020.98
5.5.300.0070.07320.89
5.5.290.0100.07020.92
5.5.280.0170.08320.98
5.5.270.0030.08321.02
5.5.260.0130.04720.89
5.5.250.0130.07320.79
5.5.240.0170.07020.23
5.5.230.0100.08320.36
5.5.220.0100.07020.30
5.5.210.0030.05720.33
5.5.200.0070.07020.31
5.5.190.0130.07720.22
5.5.180.0100.08020.22
5.5.160.0200.06720.18
5.5.150.0030.07020.35
5.5.140.0100.06020.27
5.5.130.0000.08320.30
5.5.120.0130.02720.33
5.5.110.0170.06320.17
5.5.100.0130.07320.28
5.5.90.0070.07020.27
5.5.80.0100.07720.16
5.5.70.0070.05320.16
5.5.60.0030.07320.13
5.5.50.0030.04320.04
5.5.40.0270.05720.12
5.5.30.0030.07720.16
5.5.20.0030.04020.16
5.5.10.0130.06720.19
5.5.00.0070.04720.10

preferences:
46.99 ms | 400 KiB | 5 Q