3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($string) { $output = false; $encrypt_method = "AES-256-CBC"; $secret_key = 'ExampleKey'; $secret_iv = 'ExampleIv'; // hash $key = hash('sha256', $secret_key); $iv = substr(hash('sha256', $secret_iv), 0, 16); $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv); $output = base64_encode($output); return $output; } echo encrypt("01234567890123").PHP_EOL; echo encrypt("012345678901234").PHP_EOL; echo encrypt("0123456789012345").PHP_EOL; echo encrypt("01234567890123456").PHP_EOL;

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.5.30.0130.00817.14
8.5.20.0110.00719.40
8.5.10.0090.00916.77
8.5.00.0100.01120.16
8.4.180.0110.01019.95
8.4.170.0140.00920.31
8.4.160.0120.01021.81
8.4.150.0070.00616.96
8.4.140.0120.00817.83
8.4.130.0060.00217.96
8.4.120.0070.00223.73
8.4.110.0120.00717.84
8.4.100.0100.01017.96
8.4.90.0150.00520.52
8.4.80.0120.00819.06
8.4.70.0060.00418.88
8.4.60.0110.00818.92
8.4.50.0130.00822.33
8.4.40.0030.00619.62
8.4.30.0110.00819.45
8.4.20.0040.00419.75
8.4.10.0060.00919.54
8.3.300.0140.01020.54
8.3.290.0130.00720.99
8.3.280.0100.01018.31
8.3.270.0110.00816.70
8.3.260.0050.00416.69
8.3.250.0100.00918.62
8.3.240.0120.00717.30
8.3.230.0070.01216.96
8.3.220.0120.00618.87
8.3.210.0120.00818.60
8.3.200.0050.00416.63
8.3.190.0090.00516.94
8.3.180.0100.00719.05
8.3.170.0120.00616.55
8.3.160.0140.00417.05
8.3.150.0060.01217.27
8.3.140.0000.00816.84
8.3.130.0030.00618.35
8.3.120.0040.01220.68
8.3.110.0040.00720.94
8.3.100.0060.00324.06
8.3.90.0030.00526.77
8.3.80.0060.00319.36
8.3.70.0160.00318.43
8.3.60.0170.00318.58
8.3.50.0110.00717.51
8.3.40.0150.00018.74
8.3.30.0140.00018.84
8.3.20.0040.00420.16
8.3.10.0080.00020.72
8.3.00.0000.00719.02
8.2.300.0110.00822.24
8.2.290.0070.00916.89
8.2.280.0120.00718.48
8.2.270.0110.00717.36
8.2.260.0100.01018.18
8.2.250.0040.00418.73
8.2.240.0070.00417.16
8.2.230.0110.00422.58
8.2.220.0090.00037.54
8.2.210.0050.00326.77
8.2.200.0060.00318.88
8.2.190.0070.01116.75
8.2.180.0050.00916.63
8.2.170.0000.01422.96
8.2.160.0030.01019.18
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0050.00319.37
8.2.120.0070.00026.35
8.2.110.0030.00621.06
8.2.100.0040.00817.78
8.2.90.0040.00417.84
8.2.80.0030.00618.03
8.2.70.0080.00017.91
8.2.60.0090.00018.09
8.2.50.0000.00918.10
8.2.40.0040.00420.42
8.2.30.0040.00419.20
8.2.20.0000.00718.12
8.2.10.0000.00718.06
8.2.00.0030.00518.09
8.1.340.0130.01117.66
8.1.330.0100.00916.34
8.1.320.0080.00616.45
8.1.310.0130.00316.28
8.1.300.0050.00320.32
8.1.290.0090.00030.84
8.1.280.0110.01125.92
8.1.270.0040.00423.91
8.1.260.0070.00026.35
8.1.250.0050.00228.09
8.1.240.0040.00422.14
8.1.230.0090.00322.75
8.1.220.0000.00817.76
8.1.210.0040.00418.84
8.1.200.0000.01217.23
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0000.00818.51
8.1.160.0050.00218.80
8.1.150.0040.00420.13
8.1.140.0000.00719.50
8.1.130.0070.00018.80
8.1.120.0040.00417.43
8.1.110.0050.00317.38
8.1.100.0040.00417.32
8.1.90.0000.00717.31
8.1.80.0030.00317.39
8.1.70.0000.00717.40
8.1.60.0080.00017.58
8.1.50.0050.00217.42
8.1.40.0050.00317.49
8.1.30.0000.00717.57
8.1.20.0040.00417.66
8.1.10.0050.00317.44
8.1.00.0000.00817.52
8.0.300.0040.00419.83
8.0.290.0040.00416.75
8.0.280.0000.00718.27
8.0.270.0030.00317.16
8.0.260.0030.00518.84
8.0.250.0000.00716.98
8.0.240.0000.00716.96
8.0.230.0030.00316.86
8.0.220.0030.00516.92
8.0.210.0000.00716.84
8.0.200.0030.00317.00
8.0.190.0040.00416.98
8.0.180.0050.00216.95
8.0.170.0000.00716.82
8.0.160.0000.00816.95
8.0.150.0030.00316.85
8.0.140.0000.00716.85
8.0.130.0060.00013.38
8.0.120.0000.00716.88
8.0.110.0000.00716.88
8.0.100.0000.00716.94
8.0.90.0080.00016.85
8.0.80.0050.00916.91
8.0.70.0000.00817.02
8.0.60.0080.00016.93
8.0.50.0040.00416.88
8.0.30.0120.00717.16
8.0.20.0120.01017.42
8.0.10.0040.00417.07
8.0.00.0070.01016.66
7.4.330.0020.00215.55
7.4.320.0060.00016.41
7.4.300.0000.00616.41
7.4.290.0070.00016.36
7.4.280.0040.00416.63
7.4.270.0000.00716.51
7.4.260.0040.00416.47
7.4.250.0040.00416.45
7.4.240.0070.00016.47
7.4.230.0000.00716.59
7.4.220.0030.01416.55
7.4.210.0070.01116.58
7.4.200.0070.00016.42
7.4.160.0060.01016.45
7.4.150.0100.01017.40
7.4.140.0120.01017.86
7.4.130.0160.00916.39
7.4.120.0150.00716.46
7.4.110.0110.01116.51
7.4.100.0070.01016.64
7.4.90.0110.00816.68
7.4.80.0090.00919.39
7.4.70.0060.01116.63
7.4.60.0080.00816.50
7.4.50.0060.01016.61
7.4.40.0040.01216.26
7.4.30.0140.00316.37
7.4.00.0060.01014.79
7.3.330.0020.00213.28
7.3.320.0070.00013.38
7.3.310.0030.00316.35
7.3.300.0000.00716.27
7.3.290.0030.00316.20
7.3.280.0080.00816.30
7.3.270.0060.01217.40
7.3.260.0120.00716.45
7.3.250.0110.00916.39
7.3.240.0100.00916.44
7.3.230.0090.00916.56
7.3.210.0100.00716.27
7.3.200.0070.01016.47
7.3.190.0060.01216.25
7.3.180.0090.00916.50
7.3.170.0100.00716.57
7.3.160.0060.00916.29
7.2.330.0060.01116.60
7.2.320.0030.01316.59
7.2.310.0100.00716.39
7.2.300.0080.01216.54
7.2.290.0110.00516.50
7.2.60.0030.01316.78
7.1.200.0090.00315.57
7.1.90.0060.00718.06
7.1.80.0050.00918.07
7.1.70.0040.00917.05
7.1.60.0220.01035.01
7.1.50.0170.01135.00
7.1.40.0150.01234.49
7.1.30.0150.01334.75
7.1.20.0220.00734.61
7.1.10.0090.00616.53
7.1.00.0080.00616.58
7.0.230.0050.00917.58
7.0.220.0030.01017.78
7.0.210.0060.00616.60
7.0.200.0020.01216.59
7.0.190.0030.00916.63
7.0.180.0070.00816.04
7.0.170.0060.00716.19
7.0.160.0070.00716.42
7.0.150.0050.00816.17
7.0.140.0060.00716.17
7.0.130.0060.00616.53
7.0.120.0030.01016.54
7.0.110.0070.00616.26
7.0.100.0020.01216.34
7.0.90.0040.00916.29
7.0.80.0060.00716.40
7.0.70.0020.01216.34
7.0.60.0050.00816.11
7.0.50.0070.00916.43
7.0.40.0040.00916.44
7.0.30.0030.01016.45
7.0.20.0060.00716.41
7.0.10.0060.00716.45
7.0.00.0060.00916.33

preferences:
45.67 ms | 1512 KiB | 5 Q