3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_simple_crypt( $string, $action = 'e' ) { // you may change these values to your own $secret_key = 'my_simple_secret_key'; $secret_iv = 'my_simple_secret_iv'; $output = false; $encrypt_method = "AES-256-CBC"; $key = hash( 'sha256', $secret_key ); $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 ); if( $action == 'e' ) { $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) ); } else if( $action == 'd' ){ $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv ); } return $output; } $encrypted = my_simple_crypt( '10000', 'e' ); echo $encrypted; $decrypted = my_simple_crypt( 'RTlOMytOZStXdjdHbDZtamNDWFpGdz09', 'd' );

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.40.0160.00618.64
8.3.30.0090.00618.87
8.3.20.0080.00019.21
8.3.10.0050.00320.95
8.3.00.0040.00417.93
8.2.170.0120.00322.96
8.2.160.0100.00319.12
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0060.00319.64
8.2.120.0070.00026.35
8.2.110.0030.00619.12
8.2.100.0090.00317.72
8.2.90.0080.00017.72
8.2.80.0050.00318.92
8.2.70.0000.00818.04
8.2.60.0040.00417.80
8.2.50.0040.00418.10
8.2.40.0040.00420.90
8.2.30.0000.00719.41
8.2.20.0040.00417.88
8.2.10.0040.00417.94
8.2.00.0030.00319.43
8.1.270.0040.00423.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00521.86
8.1.230.0080.00320.87
8.1.220.0060.00318.61
8.1.210.0050.00318.77
8.1.200.0030.00617.13
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0110.00418.27
8.1.160.0040.00418.89
8.1.150.0000.00918.93
8.1.140.0000.00817.71
8.1.130.0000.00718.91
8.1.120.0070.00017.46
8.1.110.0000.00717.37
8.1.100.0040.00417.41
8.1.90.0040.00417.52
8.1.80.0060.00317.37
8.1.70.0040.00417.49
8.1.60.0050.00317.48
8.1.50.0000.00817.48
8.1.40.0000.00817.56
8.1.30.0050.00217.67
8.1.20.0000.00717.61
8.1.10.0080.00017.45
8.1.00.0000.00817.52
8.0.300.0070.00019.90
8.0.290.0040.00416.63
8.0.280.0000.00718.30
8.0.270.0070.00017.20
8.0.260.0050.00317.19
8.0.250.0000.00716.96
8.0.240.0000.00716.96
8.0.230.0000.00816.96
8.0.220.0030.00316.88
8.0.210.0000.00616.91
8.0.200.0030.00316.92
8.0.190.0040.00416.91
8.0.180.0000.00816.89
8.0.170.0050.00316.95
8.0.160.0000.00816.83
8.0.150.0040.00416.87
8.0.140.0030.00316.85
8.0.130.0030.00313.30
8.0.120.0040.00416.81
8.0.110.0040.00416.93
8.0.100.0000.00717.01
8.0.90.0000.00716.92
8.0.80.0070.00816.89
8.0.70.0000.00716.70
8.0.60.0040.00416.95
8.0.50.0050.00317.00
8.0.30.0120.00917.20
8.0.20.0090.01017.40
8.0.10.0040.00416.95
8.0.00.0100.00716.73
7.4.330.0050.00015.55
7.4.320.0040.00416.41
7.4.300.0030.00316.63
7.4.290.0030.00316.52
7.4.280.0030.00516.49
7.4.270.0070.00016.50
7.4.260.0070.00016.43
7.4.250.0040.00416.46
7.4.240.0040.00416.53
7.4.230.0000.00716.71
7.4.220.0040.00416.71
7.4.210.0050.00916.65
7.4.200.0000.00716.58
7.4.160.0090.00916.57
7.4.140.0090.01017.86
7.4.130.0150.00316.55
7.4.120.0110.00916.50
7.4.110.0100.01016.62
7.4.100.0130.00316.61
7.4.90.0070.01016.49
7.4.80.0090.01219.39
7.4.70.0070.01016.43
7.4.60.0130.00616.40
7.4.50.0120.00416.34
7.4.40.0110.00816.45
7.4.00.0100.00314.98
7.3.330.0050.00013.36
7.3.320.0030.00313.36
7.3.310.0030.00316.39
7.3.300.0030.00316.32
7.3.290.0000.00716.25
7.3.280.0060.01116.42
7.3.260.0100.00816.40
7.3.240.0070.01116.56
7.3.230.0060.00916.41
7.3.210.0110.00716.41
7.3.200.0140.00716.33
7.3.190.0100.00716.36
7.3.180.0080.00816.52
7.3.170.0160.00416.52
7.3.160.0050.01116.61
7.2.330.0150.00316.41
7.2.320.0110.00616.70
7.2.310.0060.01716.47
7.2.300.0150.00716.51
7.2.290.0100.00716.59
7.2.60.0830.01114.90
7.2.50.1030.00714.94
7.2.40.0840.00815.36
7.2.30.1090.00915.34
7.2.20.1220.00815.49
7.2.10.1200.01015.44
7.2.00.1140.01115.43
7.1.200.0030.00615.48
7.1.170.1030.00813.56
7.1.160.1150.01316.88
7.1.150.1010.01016.70
7.1.140.1490.01317.08
7.1.130.1220.01617.15
7.1.120.1030.00916.95
7.1.110.1070.00916.01
7.1.100.1320.00916.12
7.1.90.1410.01416.16
7.1.80.1100.00916.46
7.1.70.1340.01015.38
7.1.60.1380.00933.46
7.1.50.1360.01233.14
7.1.40.1450.01133.02
7.1.30.1490.01832.75
7.1.20.1840.01832.86
7.1.10.1650.01114.78
7.1.00.1420.00914.97

preferences:
56.09 ms | 400 KiB | 5 Q