3v4l.org

run code in 300+ PHP versions simultaneously
<?php $encryption_key="adfgjderuspmwzwt"; $encryptedText = "02eftQAHQKejcfMJYbm06GD21HqFCj55uhAMLqbdGEONSHWLVMn1dIchgEFCNZvCSW7oPM44qyqQ"; $key="adfgjderuspmwzwt"; $data = "02eftQAHQKejcfMJYbm06GD21HqFCj55uhAMLqbdGEONSHWLVMn1dIchgEFCNZvCSW7oPM44qyqQ"; /*$encryptionMethod = "AES-256-CBC"; // DEFINE our cipher define('AES_256_CBC', 'aes-256-cbc'); // Generate a 256-bit encryption key // This should be stored somewhere instead of recreating it each time $encryption_key = openssl_random_pseudo_bytes(32); $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($encryptionMethod)); $encrypted = $encryptedText . ':' . $iv; $parts = explode(':', $encrypted); $decrypted = openssl_decrypt($parts[0], $encryptionMethod, $encryption_key, 0, $parts[1]); echo "Decrypted: $decrypted\n";*/ /*function decrypt($data, $key) { $decode = base64_decode($data); return mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$decode,"MCRYPT_MODE_CBC","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); } decrypt($data, $key);*/ print("-- Start --<br />"); include("AES.class.php"); $z = $_POST['adfgjderuspmwzwt']; $data = $_POST['plaintext']; $mode = $_POST['CBC']; $iv = $_POST['1234567890abcdef']; $aes = new AES($z, $mode, $iv); $starte = microtime(true); $encrypted = $aes->encrypt($data); $ende = microtime(true); print "Execution time to encrypt: " . ($ende - $starte) . " seconds<br />"; print "Cipher-Text: " . $encrypted . "<br />"; print "Hex: " . bin2hex($encrypted) . "<br />"; print "Base 64: " . base64_encode($encrypted) . "<br /><br />"; $startd = microtime(true); $decrypted = $aes->decrypt($encryptedText); $endd = microtime(true); print "Execution time to decrypt: " . ($endd - $startd) . " seconds<br />"; print "Decrypted-Text: " . stripslashes($decrypted); print "<br />-- End --<br />";

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)
7.3.10.0090.00616.77
7.3.00.0120.00316.42
7.2.130.0060.00616.99
7.2.120.0040.00816.94
7.2.110.0070.00416.97
7.2.100.0100.00416.81
7.2.90.0140.00316.90
7.2.80.0150.00316.86
7.2.70.0150.00417.02
7.2.60.0060.00616.94
7.2.50.0080.00417.04
7.2.40.0060.00916.74
7.2.30.0000.01416.87
7.2.20.0040.00716.78
7.2.10.0160.01017.29
7.2.00.0120.01117.89
7.1.250.0040.00815.64
7.1.130.0260.00916.76
7.1.120.0300.00417.23
7.1.110.0290.00716.30
7.1.100.0260.00816.11
7.1.90.0290.00715.97
7.1.80.0250.01115.80
7.1.70.0120.00616.22
7.1.60.0210.00525.34
7.1.50.0170.01524.92
7.1.40.0250.01232.72
7.1.30.0290.01532.63
7.1.20.0270.03536.37
7.1.10.0320.04217.61
7.1.00.0440.03918.55
7.0.270.0300.00416.34
7.0.260.1390.01016.51
7.0.250.0220.01615.86
7.0.240.0330.00615.71
7.0.230.0240.00715.73
7.0.220.0250.01915.59
7.0.210.0180.00714.63
7.0.200.0140.01015.91
7.0.190.0220.00714.62
7.0.180.0140.01014.60
7.0.170.0210.00714.29
7.0.160.0500.04817.14
7.0.150.0450.03617.25
7.0.140.0430.03717.35
7.0.130.0400.04018.21
7.0.120.0550.02517.34
7.0.110.0440.03717.36
7.0.100.0430.03217.42
7.0.90.0110.03517.36
7.0.80.1100.03317.24
7.0.70.0450.03417.31
7.0.60.0400.03517.04
7.0.50.0140.03318.33
7.0.40.0440.02917.21
7.0.30.0410.03417.43
7.0.20.0380.04417.24
7.0.10.0360.03517.24
7.0.00.0140.03118.11
5.6.300.0170.05020.70
5.6.290.0050.06020.73
5.6.280.0120.05620.83
5.6.270.0120.05420.71
5.6.260.0120.05320.68
5.6.250.0050.06020.81
5.6.240.0050.06220.67
5.6.230.0100.06020.72
5.6.220.0100.05820.77
5.6.210.0080.05920.83
5.6.200.0120.05820.66
5.6.190.0150.07220.76
5.6.180.0070.06020.85
5.6.170.0070.06120.76
5.6.160.0130.05520.82
5.6.150.0100.05920.76
5.6.140.0070.06320.76
5.6.130.0180.05020.80
5.6.120.0030.06620.71
5.6.110.0100.05820.71
5.6.100.0050.06520.88
5.6.90.0080.05720.75
5.6.80.0150.04720.02
5.6.70.0060.06120.14
5.6.60.0220.04820.12
5.6.50.0120.05220.04
5.6.40.0120.05320.22
5.6.30.0130.05520.13
5.6.20.0030.06820.15
5.6.10.0150.05120.02
5.6.00.0100.05420.15
5.5.380.0100.05317.41
5.5.370.0140.04917.41
5.5.360.0100.05417.48
5.5.350.0130.05317.42
5.5.340.0120.05117.80
5.5.330.0070.05517.98
5.5.320.0070.05918.08
5.5.310.0030.05917.81
5.5.300.0090.05317.97
5.5.290.0040.06317.78
5.5.280.0130.05317.78
5.5.270.0190.04617.95
5.5.260.0130.05417.88
5.5.250.0100.05317.70
5.5.240.0160.04517.48
5.5.230.0100.05417.27
5.5.220.0070.05317.36
5.5.210.0030.06017.09
5.5.200.0130.04917.33
5.5.190.0100.05217.10
5.5.180.0070.05817.41
5.5.160.0070.05317.24
5.5.150.0070.05317.25
5.5.140.0070.05217.28
5.5.130.0100.04917.32
5.5.120.0120.04817.06
5.5.110.0100.06117.23
5.5.100.0070.05517.15
5.5.90.0030.05517.22
5.5.80.0140.04517.16
5.5.70.0130.05417.13
5.5.60.0100.04917.18
5.5.50.0070.05217.21
5.5.40.0030.05517.22
5.5.30.0190.04117.24
5.5.20.0190.04217.30
5.5.10.0060.05417.22
5.5.00.0070.05317.29
5.4.450.0100.05819.42
5.4.440.0130.05219.28
5.4.430.0190.04219.29
5.4.420.0000.06119.33
5.4.410.0210.04119.19
5.4.400.0070.05218.82
5.4.390.0210.05419.04
5.4.380.0000.06018.99
5.4.370.0150.04719.09
5.4.360.0140.05218.95
5.4.350.0070.05319.18
5.4.340.0100.05618.93
5.4.320.0100.05518.80
5.4.310.0160.04318.99
5.4.300.0070.05219.09
5.4.290.0100.05118.82
5.4.280.0160.04519.01
5.4.270.0220.04619.00
5.4.260.0070.05419.08
5.4.250.0150.04818.79
5.4.240.0100.05119.01
5.4.230.0070.05319.18
5.4.220.0030.05718.77
5.4.210.0130.04718.79
5.4.200.0170.04318.79
5.4.190.0070.05318.85
5.4.180.0070.05619.04
5.4.170.0100.04919.07
5.4.160.0160.04218.96
5.4.150.0140.04818.99
5.4.140.0140.04816.42
5.4.130.0070.05116.41
5.4.120.0140.04116.47
5.4.110.0130.04616.31
5.4.100.0170.04016.36
5.4.90.0030.05316.51
5.4.80.0100.04516.59
5.4.70.0140.04416.35
5.4.60.0100.04816.59
5.4.50.0090.04616.50
5.4.40.0040.05416.60
5.4.30.0030.05216.42
5.4.20.0120.04416.54
5.4.10.0070.05316.49
5.4.00.0000.05916.00
5.3.290.0100.05114.68
5.3.280.0100.04914.60
5.3.270.0130.04814.69
5.3.260.0060.05214.69
5.3.250.0180.04214.59
5.3.240.0170.04014.63
5.3.230.0170.04614.63
5.3.220.0070.05114.49
5.3.210.0030.05714.52
5.3.200.0100.04714.58
5.3.190.0130.04814.68
5.3.180.0100.04814.75
5.3.170.0160.04214.58
5.3.160.0130.04414.57
5.3.150.0120.04614.57
5.3.140.0100.05014.67
5.3.130.0140.05714.55
5.3.120.0130.05914.73
5.3.110.0100.05014.71
5.3.100.0030.05614.11
5.3.90.0000.05614.19
5.3.80.0070.05014.23
5.3.70.0100.04713.96
5.3.60.0090.04714.21
5.3.50.0030.05414.12
5.3.40.0070.05014.14
5.3.30.0140.04114.14
5.3.20.0190.03813.75
5.3.10.0000.05313.82
5.3.00.0000.05613.64
5.2.170.0060.04011.10
5.2.160.0030.04111.29
5.2.150.0140.03511.32
5.2.140.0100.03711.18
5.2.130.0130.03211.34
5.2.120.0090.04611.10
5.2.110.0150.03011.23
5.2.100.0030.04111.25
5.2.90.0070.04011.25
5.2.80.0130.03511.35
5.2.70.0060.04111.22
5.2.60.0180.03011.30
5.2.50.0070.04311.27
5.2.40.0040.04111.16
5.2.30.0100.03410.94
5.2.20.0100.03510.80
5.2.10.0100.03311.01
5.2.00.0060.03911.05
5.1.60.0030.03510.06
5.1.50.0070.03210.30
5.1.40.0100.02910.12
5.1.30.0060.03510.55
5.1.20.0030.03710.66
5.1.10.0060.04410.21
5.1.00.0030.03710.21
5.0.50.0070.0259.23
5.0.40.0060.0259.23
5.0.30.0030.0429.23
5.0.20.0060.0259.23
5.0.10.0040.0299.23
5.0.00.0070.0449.23
4.4.90.0040.0229.23
4.4.80.0000.0249.23
4.4.70.0000.0249.23
4.4.60.0070.0189.23
4.4.50.0040.0219.23
4.4.40.0060.0309.23
4.4.30.0070.0179.23
4.4.20.0070.0179.23
4.4.10.0030.0219.23
4.4.00.0000.0399.23
4.3.110.0000.0269.23
4.3.100.0000.0259.23
4.3.90.0030.0209.23
4.3.80.0140.0319.23
4.3.70.0060.0199.23
4.3.60.0000.0239.23
4.3.50.0000.0269.23
4.3.40.0040.0329.23
4.3.30.0000.0249.23
4.3.20.0060.0189.23
4.3.10.0030.0219.23
4.3.00.0030.0219.23

preferences:
40.36 ms | 401 KiB | 5 Q