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, $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.0000.01516.88
8.3.50.0080.01321.33
8.3.40.0120.00318.86
8.3.30.0160.00618.80
8.3.20.0000.00720.21
8.3.10.0000.00823.51
8.3.00.0060.00323.53
8.2.180.0150.00618.54
8.2.170.0180.00419.13
8.2.160.0100.00322.96
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00419.89
8.2.120.0080.00026.35
8.2.110.0070.00321.12
8.2.100.0070.00417.91
8.2.90.0080.00018.12
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0080.00018.03
8.2.50.0080.00018.07
8.2.40.0040.00422.37
8.2.30.0000.00820.67
8.2.20.0000.00817.75
8.2.10.0040.00418.04
8.2.00.0030.00618.08
8.1.280.0070.00725.92
8.1.270.0060.00322.19
8.1.260.0080.00028.09
8.1.250.0000.00828.09
8.1.240.0090.00022.61
8.1.230.0040.00720.97
8.1.220.0050.00317.79
8.1.210.0080.00018.98
8.1.200.0030.00617.36
8.1.190.0000.00817.23
8.1.180.0080.00018.10
8.1.170.0000.00918.61
8.1.160.0040.00420.80
8.1.150.0050.00318.91
8.1.140.0040.00819.57
8.1.130.0050.00217.69
8.1.120.0070.00017.54
8.1.110.0040.00417.46
8.1.100.0030.00517.51
8.1.90.0040.00417.51
8.1.80.0070.00317.55
8.1.70.0000.00717.38
8.1.60.0000.00817.58
8.1.50.0030.00617.37
8.1.40.0040.00417.57
8.1.30.0030.00517.72
8.1.20.0040.00417.68
8.1.10.0000.00817.59
8.1.00.0060.00317.59
8.0.300.0070.00020.04
8.0.290.0000.00916.88
8.0.280.0000.00718.56
8.0.270.0040.00417.30
8.0.260.0000.00717.30
8.0.250.0050.00317.02
8.0.240.0070.00017.05
8.0.230.0030.00317.04
8.0.220.0040.00417.04
8.0.210.0000.00717.02
8.0.200.0040.00416.95
8.0.190.0000.00717.07
8.0.180.0040.00416.93
8.0.170.0090.00016.98
8.0.160.0000.00717.04
8.0.150.0040.00416.98
8.0.140.0030.00516.90
8.0.130.0030.00313.43
8.0.120.0000.00816.93
8.0.110.0000.00816.93
8.0.100.0070.00017.00
8.0.90.0080.00017.03
8.0.80.0000.01516.98
8.0.70.0040.00416.91
8.0.60.0080.00016.99
8.0.50.0080.00016.95
8.0.30.0100.00717.26
8.0.20.0150.00917.41
8.0.10.0000.00817.08
8.0.00.0060.01316.79
7.4.330.0000.00516.67
7.4.320.0000.00616.65
7.4.300.0000.00616.63
7.4.290.0070.00016.61
7.4.280.0100.00016.63
7.4.270.0040.00416.47
7.4.260.0000.01116.61
7.4.250.0030.00316.61
7.4.240.0020.00516.59
7.4.230.0000.00716.52
7.4.220.0150.00416.63
7.4.210.0040.01016.57
7.4.200.0000.00716.66
7.4.160.0060.01016.61
7.4.150.0120.00617.40
7.4.140.0080.01317.86
7.4.130.0170.00316.57
7.4.120.0080.00916.47
7.4.110.0080.01116.74
7.4.100.0120.00616.61
7.4.90.0090.01016.80
7.4.80.0060.01119.39
7.4.70.0150.00616.52
7.4.60.0040.01816.73
7.4.50.0070.00716.67
7.4.40.0110.01416.63
7.4.30.0030.01316.52
7.4.00.0100.00615.24
7.3.330.0000.00513.41
7.3.320.0000.00513.25
7.3.310.0070.00016.41
7.3.300.0070.00016.31
7.3.290.0040.00416.45
7.3.280.0090.00916.44
7.3.270.0120.00617.40
7.3.260.0040.01516.53
7.3.250.0130.00616.51
7.3.240.0120.01116.73
7.3.230.0090.00916.42
7.3.210.0080.00816.48
7.3.200.0060.01119.39
7.3.190.0060.00916.58
7.3.180.0140.00416.46
7.3.170.0080.00816.51
7.3.160.0090.01216.57
7.3.120.0030.01315.17
7.3.110.0090.00615.02
7.3.100.0030.01314.79
7.3.90.0030.00615.03
7.3.80.0100.00714.94
7.3.70.0030.01314.91
7.3.60.0040.01115.00
7.3.50.0100.00314.79
7.3.40.0080.00814.71
7.3.30.0060.00314.86
7.3.20.0000.01016.45
7.3.10.0100.00616.65
7.3.00.0070.00716.58
7.2.330.0100.00716.61
7.2.320.0060.01216.73
7.2.310.0030.01316.56
7.2.300.0130.01316.75
7.2.290.0080.01516.55
7.2.240.0070.00315.30
7.2.230.0040.00815.25
7.2.220.0060.00915.15
7.2.210.0080.00515.00
7.2.200.0090.00615.14
7.2.190.0140.00014.98
7.2.180.0060.00615.31
7.2.170.0040.00715.25
7.2.160.0060.00915.18
7.2.150.0030.00917.09
7.2.140.0030.00917.14
7.2.130.0050.00517.01
7.2.120.0080.00716.95
7.2.110.0060.00816.76
7.2.100.0070.00616.81
7.2.90.0100.00316.88
7.2.80.0030.00816.95
7.2.70.0060.00616.96
7.2.60.0050.00816.96
7.2.50.0020.01016.80
7.2.40.0050.00716.94
7.2.30.0080.00716.93
7.2.20.0030.00616.92
7.2.10.0090.00416.85
7.2.00.0050.00816.83
7.1.330.0110.00415.93
7.1.320.0070.00715.79
7.1.310.0030.01515.63
7.1.300.0030.01315.97
7.1.290.0060.00615.95
7.1.280.0000.01315.70
7.1.270.0060.00815.44
7.1.260.0000.01715.59
7.1.250.0070.00515.89
7.1.240.0000.01215.93
7.1.230.0060.00615.74
7.1.220.0090.00315.79
7.1.210.0040.00815.77
7.1.200.0070.00315.62
7.1.190.0060.00615.64
7.1.180.0030.00915.73
7.1.170.0070.00315.46
7.1.160.0080.00415.77
7.1.150.0040.00415.90
7.1.140.0000.01215.71
7.1.130.0080.00315.79
7.1.120.0060.00615.93
7.1.110.0100.00315.71
7.1.100.0030.01015.94
7.1.90.0070.00315.84
7.1.80.0140.00315.84
7.1.70.0020.01116.54
7.1.60.0070.01117.40
7.1.50.0060.00916.44
7.1.40.0070.00715.84
7.1.30.0090.00315.53
7.1.20.0000.01515.79
7.1.10.0030.01315.95
7.1.00.0070.04119.17
7.0.330.0000.00815.19
7.0.320.0040.00815.42
7.0.310.0110.00315.44
7.0.300.0000.01215.18
7.0.290.0090.00615.16
7.0.280.0080.00315.57
7.0.270.0060.00315.43
7.0.260.0060.00915.59
7.0.250.0060.00615.43
7.0.240.0100.00015.17
7.0.230.0060.00615.54
7.0.220.0050.00315.54
7.0.210.0030.00915.55
7.0.200.0100.00915.28
7.0.190.0080.00315.25
7.0.180.0060.00315.57
7.0.170.0030.01015.57
7.0.160.0030.01015.27
7.0.150.0000.01415.18
7.0.140.0060.00615.56
7.0.130.0060.00915.41
7.0.120.0040.00815.34
7.0.110.0070.00415.45
7.0.100.0070.00715.24
7.0.90.0100.00015.39
7.0.80.0060.00915.48
7.0.70.0060.00615.64
7.0.60.0030.04518.44
7.0.50.0080.03716.77
7.0.40.0070.04516.84
7.0.30.0170.04116.85
7.0.20.0180.03316.83
7.0.10.0030.04816.82
7.0.00.0100.02516.75
5.6.380.0030.00914.40
5.6.370.0060.00614.45
5.6.360.0070.00714.16
5.6.350.0050.00514.16
5.6.340.0070.00714.31
5.6.330.0060.00614.50
5.6.320.0070.00714.51
5.6.310.0110.00414.56
5.6.300.0080.00814.53
5.6.290.0100.00614.41
5.6.280.0030.03317.77
5.6.270.0100.00314.08
5.6.260.0040.00714.53
5.6.250.0100.00714.30
5.6.240.0070.00714.41
5.6.230.0040.00814.39
5.6.220.0040.00714.42
5.6.210.0080.03917.54
5.6.200.0110.03816.29
5.6.190.0060.02217.62
5.6.180.0130.02917.46
5.6.170.0100.02717.48
5.6.160.0070.03217.48
5.6.150.0050.04316.37
5.6.140.0030.04816.21
5.6.130.0080.04016.19
5.6.120.0080.02717.75
5.6.110.0100.03917.72
5.6.100.0050.04417.68
5.6.90.0070.03817.66
5.6.80.0020.02617.29
5.6.70.0030.00814.42
5.6.60.0050.00514.22
5.6.50.0070.00314.05
5.6.40.0000.01014.16
5.6.30.0040.00714.07
5.6.20.0000.01614.15
5.6.10.0000.01114.34
5.6.00.0040.00714.29
5.5.380.0090.00311.18
5.5.370.0050.00311.33
5.5.360.0000.00711.43
5.5.350.0110.04015.90
5.5.340.0050.02814.64
5.5.330.0030.04515.87
5.5.320.0230.03115.80
5.5.310.0120.03615.82
5.5.300.0060.02014.57
5.5.290.0050.04614.68
5.5.280.0100.03016.12
5.5.270.0050.04416.09
5.5.260.0070.03916.12
5.5.250.0020.04716.00
5.5.240.0080.04215.65
5.5.230.0040.00811.24
5.5.220.0030.00511.19
5.5.210.0030.00311.18
5.5.200.0110.00011.20
5.5.190.0000.01111.18
5.5.180.0030.00711.22
5.5.170.0050.00311.18
5.5.160.0080.00011.30
5.5.150.0000.00811.34
5.5.140.0030.00311.34
5.5.130.0050.00311.35
5.5.120.0060.00611.29
5.5.110.0000.00611.18
5.5.100.0000.01011.18
5.5.90.0080.00011.18
5.5.80.0030.00311.18
5.5.70.0000.01111.18
5.5.60.0050.00511.18
5.5.50.0060.00611.23
5.5.40.0040.00711.23
5.5.30.0000.01011.18
5.5.20.0060.00311.34
5.5.10.0130.00011.18
5.5.00.0060.00611.18

preferences:
33.29 ms | 401 KiB | 5 Q