3v4l.org

run code in 300+ PHP versions simultaneously
<?php $partner_key = 1; $string = 'test_string'; # --- ENCRYPTION --- # the key should be random binary, use scrypt, bcrypt or PBKDF2 to # convert a string into a key # key is specified using hexadecimal $key = pack('H*', bin2hex($partner_key)); # show key size use either 16, 24 or 32 byte keys for AES-128, 192 # and 256 respectively $key_size = strlen($key); # create a random IV to use with CBC encoding $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); # creates a cipher text compatible with AES (Rijndael block size = 128) # to keep the text confidential # only suitable for encoded input that never ends with value 00h # (because of default zero padding) $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $string, MCRYPT_MODE_CBC, $iv); # prepend the IV for it to be available for decryption $ciphertext = $iv . $ciphertext; # encode the resulting cipher text so it can be represented by a string $ciphertext_base64 = base64_encode($ciphertext); //echo $ciphertext_base64 . "\n"; echo $ciphertext_base64;

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.00318.42
8.3.50.0160.00222.78
8.3.40.0120.00918.84
8.3.30.0070.01019.09
8.3.20.0070.01020.32
8.3.10.0000.00920.56
8.3.00.0080.00019.26
8.2.180.0120.00318.38
8.2.170.0030.01722.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0050.00320.97
8.2.110.0030.00722.22
8.2.100.0090.00317.91
8.2.90.0080.00018.22
8.2.80.0030.00617.97
8.2.70.0080.00417.50
8.2.60.0000.00717.80
8.2.50.0050.00318.10
8.2.40.0050.00318.20
8.2.30.0000.00719.54
8.2.20.0040.00417.62
8.2.10.0040.00418.16
8.2.00.0000.00717.84
8.1.280.0130.00925.92
8.1.270.0080.00022.17
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0120.00823.96
8.1.230.0110.00022.75
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.36
8.1.190.0080.00017.13
8.1.180.0080.00018.10
8.1.170.0030.00618.54
8.1.160.0000.00722.05
8.1.150.0040.00418.82
8.1.140.0050.00217.46
8.1.130.0000.00717.75
8.1.120.0030.00317.45
8.1.110.0000.00717.39
8.1.100.0000.00717.42
8.1.90.0000.00717.42
8.1.80.0050.00317.34
8.1.70.0030.00317.31
8.1.60.0050.00317.59
8.1.50.0040.00417.58
8.1.40.0040.00417.55
8.1.30.0000.00817.57
8.1.20.0000.00717.64
8.1.10.0040.00417.64
8.1.00.0080.00017.59
8.0.300.0070.00022.09
8.0.290.0060.00316.75
8.0.280.0070.00018.33
8.0.270.0040.00417.23
8.0.260.0070.00017.22
8.0.250.0030.00317.00
8.0.240.0000.00716.89
8.0.230.0000.00716.91
8.0.220.0050.00316.82
8.0.210.0030.00316.80
8.0.200.0070.00016.95
8.0.190.0030.00317.01
8.0.180.0030.00516.88
8.0.170.0000.00816.86
8.0.160.0040.00416.90
8.0.150.0070.00016.90
8.0.140.0000.00716.86
8.0.130.0060.00013.34
8.0.120.0000.00716.90
8.0.110.0040.00416.86
8.0.100.0000.00716.87
8.0.90.0030.00316.87
8.0.80.0130.01016.88
8.0.70.0070.00016.79
8.0.60.0050.00316.76
8.0.50.0040.00416.95
8.0.30.0110.00917.04
8.0.20.0090.01317.40
8.0.10.0070.00016.91
8.0.00.0080.00916.69
7.4.330.0000.00615.00
7.4.320.0060.00016.47
7.4.300.0030.00316.48
7.4.290.0000.00716.69
7.4.280.0040.00416.61
7.4.270.0030.00316.62
7.4.260.0000.00716.54
7.4.250.0000.00816.46
7.4.240.0020.00516.54
7.4.230.0030.00316.66
7.4.220.0070.01116.63
7.4.210.0090.00616.39
7.4.200.0070.00016.49
7.4.160.0060.01016.54
7.4.150.0120.00617.40
7.4.140.0130.00817.86
7.4.130.0060.01116.63
7.4.120.0100.00816.61
7.4.110.0120.00416.56
7.4.100.0110.00616.38
7.4.90.0090.00616.52
7.4.80.0030.01519.39
7.4.70.0030.01416.47
7.4.60.0090.01216.63
7.4.50.0000.00816.56
7.4.40.0070.01016.61
7.4.30.0100.00616.58
7.4.00.0150.00315.21
7.3.330.0000.00613.23
7.3.320.0000.00613.23
7.3.310.0000.00716.18
7.3.300.0030.00316.32
7.3.290.0060.01316.29
7.3.280.0070.00916.34
7.3.270.0070.01017.40
7.3.260.0120.00616.71
7.3.250.0060.01316.19
7.3.240.0090.00916.55
7.3.230.0070.01016.39
7.3.210.0140.00616.38
7.3.200.0060.01519.39
7.3.190.0100.00716.34
7.3.180.0130.00316.43
7.3.170.0100.01316.32
7.3.160.0030.01316.43
7.3.120.0130.00314.89
7.3.110.0040.00814.92
7.3.100.0000.01114.58
7.3.90.0000.01414.63
7.3.80.0030.01214.68
7.3.70.0060.00914.64
7.3.60.0030.00614.86
7.3.50.0030.01314.64
7.3.40.0070.00714.64
7.3.30.0060.00614.75
7.3.20.0040.00816.54
7.3.10.0070.01016.64
7.3.00.0000.01216.72
7.2.330.0120.01116.49
7.2.320.0090.00916.59
7.2.310.0150.02516.67
7.2.300.0060.01316.68
7.2.290.0120.00316.61
7.2.240.0070.01314.70
7.2.230.0000.01014.87
7.2.220.0090.00314.88
7.2.210.0070.00714.98
7.2.200.0030.00914.98
7.2.190.0100.00315.00
7.2.180.0040.00714.77
7.2.170.0030.00715.01
7.2.160.0060.00614.74
7.2.150.0040.00816.48
7.2.140.0070.00716.86
7.2.130.0060.00916.82
7.2.120.0030.01216.81
7.2.110.0100.00316.64
7.2.100.0060.00616.86
7.2.90.0030.01016.80
7.2.80.0030.01017.01
7.2.70.0000.01016.92
7.2.60.0060.00816.86
7.2.50.0040.00716.92
7.2.40.0100.00316.66
7.2.30.0100.00716.89
7.2.20.0080.00416.81
7.2.10.0000.01216.84
7.2.00.0040.00918.00
7.1.330.0100.00315.82
7.1.320.0030.00615.74
7.1.310.0080.00415.98
7.1.300.0100.00315.96
7.1.290.0070.00715.75
7.1.280.0090.00615.41
7.1.270.0030.01015.49
7.1.260.0040.00415.96
7.1.250.0000.00815.85
7.1.200.0100.00315.80
7.1.100.0600.01815.87
7.1.70.0090.00617.06
7.1.60.0160.01019.46
7.1.50.0040.01816.91
7.1.00.0070.09322.30
7.0.200.0170.00715.02
7.0.140.0030.07722.15
7.0.60.0170.07019.88
7.0.50.0130.04717.83
7.0.40.0100.08320.09
7.0.30.0270.07320.17
7.0.20.0230.04720.20
7.0.10.0170.04020.01
7.0.00.0100.08320.11
5.6.280.0070.07021.11
5.6.210.0070.05720.45
5.6.200.0170.06718.13
5.6.190.0030.06020.41
5.6.180.4300.04020.67
5.6.170.0330.08020.52
5.6.160.0130.08320.49
5.6.150.0070.07718.21
5.6.140.0000.08018.09
5.6.130.0000.09018.08
5.6.120.0200.07721.12
5.6.110.0030.07721.20
5.6.100.0100.08721.02
5.6.90.0170.07321.10
5.6.80.0100.08020.54
5.6.70.4670.03320.46
5.5.350.0030.08320.33
5.5.340.0030.05017.91
5.5.330.0100.07720.25
5.5.320.0270.04320.30
5.5.310.0230.07020.29
5.5.300.0070.08717.92
5.5.290.0030.06317.99
5.5.280.0070.03721.02
5.5.270.0070.05020.91
5.5.260.0070.07720.89
5.5.250.0100.06020.65
5.5.240.0000.04020.34
5.4.450.2000.03719.27
5.4.440.2130.05319.61
5.4.430.2200.03719.42
5.4.420.1900.04019.25
5.4.410.2200.04319.08
5.4.400.2070.04019.05
5.4.390.2230.04019.09
5.4.380.1900.03718.94
5.4.370.2200.04019.28
5.4.360.2070.03718.80
5.4.350.1870.04719.10
5.4.340.2230.04019.09
5.4.320.1930.04019.09
5.4.310.2470.04019.09
5.4.300.2130.03719.08
5.4.290.2270.04019.09
5.4.280.2070.04019.13
5.4.270.2030.03718.93
5.4.260.2100.03718.81
5.4.250.2130.04018.93
5.4.240.2000.04319.05
5.4.230.2030.03319.06
5.4.220.2030.04019.24
5.4.210.2070.03719.05
5.4.200.2270.04019.13
5.4.190.2070.03019.13
5.4.180.1870.03719.25
5.4.170.2070.03319.16
5.4.160.2030.04019.11
5.4.150.2630.03719.14
5.4.140.2230.03016.41
5.4.130.2430.04016.50
5.4.120.2070.03016.33
5.4.110.2000.04016.42
5.4.100.0030.06316.47
5.4.90.0070.06716.27
5.4.80.0030.05716.29
5.4.70.1430.03716.46
5.4.60.2330.03716.41
5.4.50.2170.03316.39
5.4.40.2200.04016.39
5.4.30.2270.03716.20
5.4.20.2130.04316.36
5.4.10.2330.03316.09
5.4.00.2700.03015.71
5.3.290.2300.05014.52
5.3.280.2000.03714.43
5.3.270.2200.04714.70
5.3.260.2370.03714.48
5.3.250.2270.03014.55
5.3.240.2030.04014.65
5.3.230.2000.03714.43
5.3.220.0270.03014.47
5.3.210.0230.06014.42
5.3.200.0270.05014.50
5.3.190.0230.07314.42
5.3.180.0300.03714.36
5.3.170.0230.03314.40
5.3.160.0200.05714.61
5.3.150.0270.07714.52
5.3.140.0270.03714.39
5.3.130.0200.05314.40
5.3.120.0270.08314.39
5.3.110.0330.04714.64
5.3.100.0270.06713.98
5.3.90.0200.03713.87
5.3.80.0230.05313.97
5.3.70.0270.03714.07
5.3.60.0170.03713.86
5.3.50.0170.03714.04
5.3.40.0230.03313.89
5.3.30.0200.03313.70
5.3.20.0230.03013.55
5.3.10.0230.03013.49
5.3.00.0170.04713.48
5.2.170.0200.02710.99
5.2.160.0200.02711.16
5.2.150.0100.03311.20
5.2.140.0200.02711.19
5.2.130.0130.03011.15
5.2.120.0170.03310.95
5.2.110.0170.02710.94
5.2.100.0100.03310.96
5.2.90.0170.02711.04
5.2.80.0170.03710.94
5.2.70.0100.04310.95
5.2.60.0170.03310.99
5.2.50.0200.02710.95
5.2.40.0100.03011.15
5.2.30.0200.03010.81
5.2.20.0100.03311.04
5.2.10.0170.03310.94
5.2.00.0070.03710.71
5.1.60.0170.0209.89
5.1.50.0200.0179.86
5.1.40.0130.0239.88
5.1.30.0170.02310.45
5.1.20.0100.03010.49
5.1.10.0130.0409.99
5.1.00.0130.0279.96
5.0.50.0070.0238.59
5.0.40.0000.0278.54
5.0.30.0070.0308.54
5.0.20.0070.0208.54
5.0.10.0070.0208.54
5.0.00.0070.0408.54
4.4.90.0100.0108.54
4.4.80.0070.0138.54
4.4.70.0000.0208.54
4.4.60.0030.0138.54
4.4.50.0030.0178.54
4.4.40.0100.0278.54
4.4.30.0070.0138.54
4.4.20.0070.0138.54
4.4.10.0100.0138.54
4.4.00.0100.0208.54
4.3.110.0070.0178.54
4.3.100.0100.0108.54
4.3.90.0030.0178.54
4.3.80.0070.0278.54
4.3.70.0070.0138.54
4.3.60.0070.0138.54
4.3.50.0030.0178.54
4.3.40.0100.0208.54
4.3.30.0070.0138.54
4.3.20.0030.0138.54
4.3.10.0000.0138.54
4.3.00.0030.0138.54

preferences:
55.01 ms | 401 KiB | 5 Q