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( 'Hello World!', '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.60.0150.00418.43
8.3.50.0140.00417.98
8.3.40.0040.01118.80
8.3.30.0090.00618.89
8.3.20.0040.00419.01
8.3.10.0040.00421.03
8.3.00.0030.00618.04
8.2.180.0090.00918.42
8.2.170.0110.00422.96
8.2.160.0070.00718.91
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0040.00419.70
8.2.120.0000.00826.35
8.2.110.0060.00320.56
8.2.100.0080.00417.85
8.2.90.0040.00418.03
8.2.80.0040.00419.28
8.2.70.0030.00617.63
8.2.60.0080.00017.93
8.2.50.0000.01018.07
8.2.40.0040.00417.97
8.2.30.0000.00817.88
8.2.20.0050.00218.00
8.2.10.0000.00718.14
8.2.00.0060.00319.54
8.1.280.0070.00725.92
8.1.270.0040.00423.97
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00422.14
8.1.230.0080.00420.85
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0000.00917.53
8.1.180.0000.00818.10
8.1.170.0000.00818.61
8.1.160.0050.00318.82
8.1.150.0000.00918.95
8.1.140.0070.00017.67
8.1.130.0030.00318.88
8.1.120.0000.00817.46
8.1.110.0040.00417.44
8.1.100.0050.00317.37
8.1.90.0000.00717.36
8.1.80.0060.00317.42
8.1.70.0000.00717.46
8.1.60.0040.00417.59
8.1.50.0000.00717.56
8.1.40.0030.00517.56
8.1.30.0040.00417.66
8.1.20.0000.00717.59
8.1.10.0000.00817.65
8.1.00.0080.00017.42
8.0.300.0080.00320.04
8.0.290.0000.00717.04
8.0.280.0000.00718.30
8.0.270.0000.00817.21
8.0.260.0000.00617.19
8.0.250.0000.00717.02
8.0.240.0030.00517.02
8.0.230.0070.00016.96
8.0.220.0030.00316.89
8.0.210.0030.00316.73
8.0.200.0040.00417.01
8.0.190.0040.00416.95
8.0.180.0000.00716.89
8.0.170.0000.00816.74
8.0.160.0040.00416.89
8.0.150.0080.00416.83
8.0.140.0070.00016.75
8.0.130.0090.00013.25
8.0.120.0000.00716.75
8.0.110.0060.00316.93
8.0.100.0000.00716.75
8.0.90.0080.00016.77
8.0.80.0080.00816.88
8.0.70.0070.00016.78
8.0.60.0040.00416.89
8.0.50.0030.00517.02
8.0.30.0120.00717.06
8.0.20.0110.00717.40
8.0.10.0030.00517.09
8.0.00.0080.00916.74
7.4.330.0000.00415.55
7.4.320.0030.00316.66
7.4.300.0000.00616.52
7.4.290.0000.00716.63
7.4.280.0080.00016.67
7.4.270.0000.00716.51
7.4.260.0000.00716.46
7.4.250.0070.00016.55
7.4.240.0080.00016.50
7.4.230.0070.00016.62
7.4.220.0040.00416.58
7.4.210.0090.00916.54
7.4.200.0030.00316.54
7.4.160.0110.00616.54
7.4.140.0080.01017.86
7.4.130.0000.01716.53
7.4.120.0090.01116.51
7.4.110.0120.00616.63
7.4.100.0080.00816.70
7.4.90.0090.00916.64
7.4.80.0090.01219.39
7.4.70.0060.01016.48
7.4.60.0060.01216.39
7.4.50.0070.01016.27
7.4.40.0090.01216.23
7.4.00.0000.01215.16
7.3.330.0000.00513.36
7.3.320.0030.00313.23
7.3.310.0070.00016.32
7.3.300.0000.00716.38
7.3.290.0030.00316.28
7.3.280.0090.00616.29
7.3.260.0100.00716.49
7.3.240.0090.01016.40
7.3.230.0080.00916.36
7.3.210.0090.00916.37
7.3.200.0150.00616.33
7.3.190.0060.00916.45
7.3.180.0080.00816.42
7.3.170.0070.01116.67
7.3.160.0040.01216.48
7.3.120.0110.00414.65
7.3.110.0060.00914.87
7.3.100.0000.01214.52
7.3.90.0030.01415.09
7.3.80.0070.00714.97
7.3.70.0110.00314.68
7.3.60.0060.00614.85
7.3.50.0030.01014.56
7.3.40.0060.00314.71
7.3.30.0040.01114.83
7.3.20.0080.00016.59
7.3.10.0030.01216.79
7.3.00.0030.01016.71
7.2.330.0170.00716.78
7.2.320.0130.00316.77
7.2.310.0110.01416.79
7.2.300.0120.00916.81
7.2.290.0120.00616.52
7.2.240.0030.00715.18
7.2.230.0120.00615.00
7.2.220.0070.01014.86
7.2.210.0100.00315.23
7.2.200.0000.01315.09
7.2.190.0070.00714.90
7.2.180.0080.00414.93
7.2.170.0090.00614.79
7.2.160.0080.00014.74
7.2.150.0090.00916.96
7.2.140.0040.01116.68
7.2.130.0030.01316.82
7.2.120.0030.01016.93
7.2.110.0070.00416.83
7.2.100.0030.00816.82
7.2.90.0080.00417.06
7.2.80.0030.01416.66
7.2.70.0080.00416.95
7.2.60.0950.01015.93
7.2.50.0910.00816.01
7.2.40.0740.00716.12
7.2.30.0620.01016.01
7.2.20.0620.01016.04
7.2.10.0720.01116.03
7.2.00.0610.00716.13
7.1.330.0040.00715.64
7.1.320.0030.01215.60
7.1.310.0110.00415.91
7.1.300.0070.00715.61
7.1.290.0030.01215.63
7.1.280.0030.01015.37
7.1.270.0030.01015.85
7.1.260.0070.00415.64
7.1.250.0000.01115.84
7.1.200.0040.00715.54
7.1.170.1810.00613.46
7.1.160.1110.01116.65
7.1.150.1060.01216.82
7.1.140.1310.01417.06
7.1.130.1300.01017.14
7.1.120.1210.01317.02
7.1.110.1130.01216.58
7.1.100.1210.01116.26
7.1.90.1510.01216.30
7.1.80.1690.01216.34
7.1.70.1800.01215.50
7.1.60.1690.01733.46
7.1.50.2200.01333.14
7.1.40.2120.01632.77
7.1.30.2260.01432.91
7.1.20.2190.01732.70
7.1.10.1950.01114.66
7.1.00.1370.01115.08

preferences:
63.77 ms | 400 KiB | 5 Q