3v4l.org

run code in 300+ PHP versions simultaneously
<?php $this->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($this->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"; return $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.0120.00418.68
8.3.50.0130.00822.86
8.3.40.0120.00918.64
8.3.30.0120.00619.21
8.3.20.0050.00220.35
8.3.10.0090.00020.66
8.3.00.0120.00019.38
8.2.180.0120.00316.50
8.2.170.0140.00022.96
8.2.160.0110.00320.41
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.09
8.2.110.0060.00319.45
8.2.100.0000.01117.91
8.2.90.0080.00019.22
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0000.00817.80
8.2.50.0000.00718.10
8.2.40.0030.00522.37
8.2.30.0040.00419.22
8.2.20.0070.00017.56
8.2.10.0040.00419.63
8.2.00.0040.00417.75
8.1.280.0100.00325.92
8.1.270.0050.00322.14
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00320.77
8.1.230.0060.00617.82
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0070.00017.64
8.1.180.0070.00018.10
8.1.170.0080.00018.43
8.1.160.0000.00718.72
8.1.150.0040.00418.77
8.1.140.0040.00417.32
8.1.130.0030.00317.72
8.1.120.0040.00417.33
8.1.110.0000.00717.33
8.1.100.0000.00717.22
8.1.90.0050.00217.33
8.1.80.0040.00417.23
8.1.70.0000.00717.28
8.1.60.0030.00517.52
8.1.50.0040.00417.46
8.1.40.0040.00417.48
8.1.30.0040.00417.46
8.1.20.0040.00417.48
8.1.10.0030.00617.52
8.1.00.0000.00717.50
8.0.300.0040.00419.09
8.0.290.0000.00716.75
8.0.280.0030.00318.38
8.0.270.0040.00417.18
8.0.260.0030.00317.20
8.0.250.0000.00716.92
8.0.240.0000.00616.95
8.0.230.0030.00316.89
8.0.220.0040.00416.78
8.0.210.0070.00016.86
8.0.200.0000.00716.84
8.0.190.0030.00516.97
8.0.180.0000.00716.97
8.0.170.0040.00416.82
8.0.160.0030.00516.89
8.0.150.0040.00416.77
8.0.140.0080.00016.76
8.0.130.0030.00313.25
8.0.120.0000.00816.83
8.0.110.0000.00716.87
8.0.100.0050.00316.87
8.0.90.0070.00016.96
8.0.80.0070.01516.94
8.0.70.0000.00716.69
8.0.60.0040.00416.85
8.0.50.0040.00416.80
8.0.30.0180.00316.90
8.0.20.0120.00617.40
8.0.10.0000.00716.94
8.0.00.0100.00716.71
7.4.330.0020.00215.02
7.4.320.0000.00616.39
7.4.300.0070.00016.54
7.4.290.0070.00016.45
7.4.280.0030.00716.58
7.4.270.0030.00316.38
7.4.260.0030.00516.29
7.4.250.0040.00416.43
7.4.240.0000.00716.41
7.4.230.0000.00716.53
7.4.220.0130.00616.56
7.4.210.0070.01016.54
7.4.200.0030.00316.33
7.4.160.0170.00016.41
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0080.00916.50
7.4.120.0060.01116.61
7.4.110.0170.00016.46
7.4.100.0140.00416.52
7.4.90.0090.01216.50
7.4.80.0110.00719.39
7.4.70.0100.00616.54
7.4.60.0070.01416.60
7.4.50.0050.00016.56
7.4.40.0160.00016.38
7.4.30.0060.01016.65
7.4.00.0110.00315.16
7.3.330.0000.00613.13
7.3.320.0000.00612.98
7.3.310.0030.00316.23
7.3.300.0030.00316.04
7.3.290.0070.00716.26
7.3.280.0050.00916.27
7.3.270.0080.00817.40
7.3.260.0090.00916.30
7.3.250.0120.00816.48
7.3.240.0110.00616.58
7.3.230.0000.01616.48
7.3.210.0140.00416.48
7.3.200.0030.01319.39
7.3.190.0110.00716.46
7.3.180.0000.01516.36
7.3.170.0150.00316.40
7.3.160.0100.00616.24
7.3.120.0100.00314.93
7.3.110.0070.00714.58
7.3.100.0060.00614.73
7.3.90.0030.00914.73
7.3.80.0080.00614.63
7.3.70.0100.00314.60
7.3.60.0000.01214.41
7.3.50.0030.00714.69
7.3.40.0040.01114.71
7.3.30.0060.00914.42
7.3.20.0040.01116.21
7.3.10.0060.00816.37
7.3.00.0060.00316.38
7.2.330.0080.01516.28
7.2.320.0030.01316.30
7.2.310.0230.02616.57
7.2.300.0110.00816.56
7.2.290.0040.01816.56
7.2.240.0070.00715.06
7.2.230.0090.00914.61
7.2.220.0000.01014.90
7.2.210.0110.00314.85
7.2.200.0110.00414.60
7.2.190.0000.01415.00
7.2.180.0040.00814.92
7.2.170.0120.00014.87
7.2.160.0030.01214.63
7.2.150.0120.00016.69
7.2.140.0090.00616.76
7.2.130.0100.00616.80
7.2.120.0030.00716.52
7.2.110.0000.01516.84
7.2.100.0040.01116.71
7.2.90.0000.01416.72
7.2.80.0000.01516.89
7.2.70.0120.00316.89
7.2.60.0100.01016.89
7.2.50.0030.01516.84
7.2.40.0000.01616.89
7.2.30.0130.00316.81
7.2.20.0090.00916.54
7.2.10.0120.00316.57
7.2.00.0130.00016.49
7.1.330.0000.01115.69
7.1.320.0130.00315.40
7.1.310.0030.01315.61
7.1.300.0090.00615.67
7.1.290.0030.01015.36
7.1.280.0060.00615.45
7.1.270.0000.01415.57
7.1.260.0100.00615.56
7.1.250.0060.00815.32
7.1.200.0090.00615.77
7.1.100.0690.01115.68
7.1.70.0030.00617.00
7.1.60.0130.01319.46
7.1.50.0130.01016.49
7.1.00.0070.09322.33
7.0.200.0180.00314.82
7.0.140.0030.07721.92
7.0.110.0070.09021.61
7.0.100.0100.07721.75
7.0.90.0070.08321.64
7.0.80.0070.08021.69
7.0.70.0030.08721.67
7.0.60.0070.08021.64
7.0.50.0030.09021.98
7.0.40.0100.08020.22
7.0.30.0070.08320.17
7.0.20.0170.07320.13
7.0.10.0100.03720.10
7.0.00.0070.04719.97
5.6.280.0000.07721.04
5.6.260.0070.07720.67
5.6.250.0030.06720.61
5.6.240.0070.08320.64
5.6.230.0130.07720.57
5.6.220.0130.07320.63
5.6.210.0030.07720.51
5.6.200.0100.05721.21
5.6.190.0170.04721.09
5.6.180.0100.04021.08
5.6.170.0030.08021.03
5.6.160.0000.08321.23
5.6.150.0000.05021.09
5.6.140.0100.07321.02
5.6.130.0100.07320.90
5.6.120.0100.07720.97
5.6.110.0070.05020.92
5.6.100.0230.06721.20
5.6.90.0130.04320.85
5.6.80.0100.07720.55
5.6.70.0070.08020.25
5.6.60.0270.04720.46
5.6.50.0200.04720.26
5.6.40.0030.07720.18
5.6.30.0170.06720.44
5.6.20.0000.07720.39
5.6.10.0000.06320.45
5.6.00.0130.06720.24
5.5.380.0000.07720.43
5.5.370.0070.06720.30
5.5.360.0070.08320.26
5.5.350.0000.09020.40
5.5.340.0070.08320.71
5.5.330.0130.07020.64
5.5.320.0130.06720.89
5.5.310.0030.07320.71
5.5.300.0030.08320.64
5.5.290.0130.06720.64
5.5.280.0070.08720.75
5.5.270.0130.07320.71
5.5.260.0070.05720.62
5.5.250.0100.06720.73
5.5.240.0100.07320.13
5.5.230.0230.07020.21
5.5.220.0200.06720.09
5.5.210.0100.07320.02
5.5.200.0200.06720.31
5.5.190.0100.06720.33
5.5.180.0030.08720.10
5.5.160.0100.07320.20
5.5.150.0170.06720.04
5.5.140.0100.07320.10
5.5.130.0070.04320.31
5.5.120.0070.06720.29
5.5.110.0000.07020.30
5.5.100.0030.07320.18
5.5.90.0070.07720.09
5.5.80.0130.07020.20
5.5.70.0030.08720.14
5.5.60.0100.07319.98
5.5.50.0130.07319.98
5.5.40.0170.06719.93
5.5.30.0130.06720.00
5.5.20.0030.08020.17
5.5.10.0100.07319.85
5.5.00.0100.07020.05
5.4.450.0030.07319.43
5.4.440.0070.07019.42
5.4.430.0130.07019.57
5.4.420.0030.08019.48
5.4.410.0030.08319.37
5.4.400.0100.07319.14
5.4.390.0100.07019.03
5.4.380.0030.05719.00
5.4.370.0070.06319.16
5.4.360.0030.05719.01
5.4.350.0030.08019.27
5.4.340.0070.07018.97
5.4.320.0070.07318.95
5.4.310.0170.08019.10
5.4.300.0070.08019.11
5.4.290.0070.08019.04
5.4.280.0170.06719.02
5.4.270.0170.07019.00
5.4.260.0100.06719.14
5.4.250.0100.07019.16
5.4.240.0030.08319.00
5.4.230.0030.07719.09
5.4.220.0100.07719.11
5.4.210.0030.04718.99
5.4.200.0130.07018.95
5.4.190.0100.07319.09
5.4.180.0070.07018.94
5.4.170.0030.09019.11
5.4.160.0070.07319.08
5.4.150.0070.07018.93
5.4.140.0170.02716.21
5.4.130.0070.04016.14
5.4.120.0070.07716.14
5.4.110.0030.08016.50
5.4.100.0100.05316.38
5.4.90.0130.06316.48
5.4.80.0030.05316.39
5.4.70.0030.07716.49
5.4.60.0070.07016.26
5.4.50.0070.06316.35
5.4.40.0100.07016.38
5.4.30.0030.07716.38
5.4.20.0070.07016.47
5.4.10.0030.07716.35
5.4.00.0030.07715.92
5.3.290.0000.07014.68
5.3.280.0130.07014.59
5.3.270.0030.08014.50
5.3.260.0100.06714.62
5.3.250.0070.07714.68
5.3.240.0070.07314.53
5.3.230.0100.05314.54
5.3.220.0100.07014.51
5.3.210.0070.06014.48
5.3.200.0070.05714.50
5.3.190.0100.07314.66
5.3.180.0100.06714.58
5.3.170.0200.05714.35
5.3.160.0070.07014.63
5.3.150.0100.07314.63
5.3.140.0100.06714.34
5.3.130.0030.08014.33
5.3.120.0130.06714.39
5.3.110.0100.07314.61
5.3.100.0070.05314.03
5.3.90.0030.07713.80
5.3.80.0030.04313.95
5.3.70.0000.07713.96
5.3.60.0030.07714.07
5.3.50.0100.07013.84
5.3.40.0030.08013.77
5.3.30.0030.07013.84
5.3.20.0130.07013.59
5.3.10.0070.07013.66
5.3.00.0100.06713.57
5.2.170.0030.06311.30
5.2.160.0200.02711.16
5.2.150.0030.06711.03
5.2.140.0130.06011.29
5.2.130.0070.06311.03
5.2.120.0030.03710.89
5.2.110.0070.06311.04
5.2.100.0030.06711.16
5.2.90.0030.05011.16
5.2.80.0030.07011.02
5.2.70.0170.05311.02
5.2.60.0030.06710.97
5.2.50.0100.06011.01
5.2.40.0100.05310.92
5.2.30.0070.06010.96
5.2.20.0070.05711.03
5.2.10.0000.06710.86
5.2.00.0030.05310.70
5.1.60.0100.04710.56
5.1.50.0030.05710.56
5.1.40.0100.02710.56
5.1.30.0070.05710.56
5.1.20.0030.05710.56
5.1.10.0070.05310.56
5.1.00.0070.04310.56
5.0.50.0030.03710.56
5.0.40.0070.03710.56
5.0.30.0030.06310.56
5.0.20.0030.04710.56
5.0.10.0000.04710.56
5.0.00.0030.06310.56
4.4.90.0000.04010.56
4.4.80.0030.02710.56
4.4.70.0000.03710.56
4.4.60.0030.03310.56
4.4.50.0070.03310.56
4.4.40.0030.03310.56
4.4.30.0030.03010.56
4.4.20.0000.03710.56
4.4.10.0000.03710.56
4.4.00.0000.05310.56
4.3.110.0100.02310.56
4.3.100.0000.03710.56
4.3.90.0030.03310.56
4.3.80.0000.05010.56
4.3.70.0030.03310.56
4.3.60.0070.02710.56
4.3.50.0070.03310.56
4.3.40.0000.04310.56
4.3.30.0070.03010.56
4.3.20.0000.04010.56
4.3.10.0000.03710.56
4.3.00.0000.03310.56

preferences:
43.27 ms | 401 KiB | 5 Q