3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = hex2bin('404142434445464748494a4b4c4d4e4f'); $iv = hex2bin('10111213141516'); $aad = hex2bin('0001020304050607'); $plaintext = hex2bin('2021222'); $C = hex2bin('2021222'); $T = hex2bin('6084341b'); $tag = null; $cipher = openssl_encrypt($plaintext, 'aes-128-ccm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 4); var_dump( bin2hex($cipher), bin2hex($C), bin2hex($tag), bin2hex($T) ); /* private byte[] K1 = Hex.decode("404142434445464748494a4b4c4d4e4f"); private byte[] N1 = Hex.decode("10111213141516"); private byte[] A1 = Hex.decode("0001020304050607"); private byte[] P1 = Hex.decode("20212223"); private byte[] C1 = Hex.decode("7162015b4dac255d"); private byte[] T1 = Hex.decode("6084341b"); */ /* var_dump('411d89ff74205c106d8d85a8'); // What we want echo PHP_EOL; $key = base64_decode('Z4lAXU62WxDi46zSV67FeLj3hSK/th1Z73VD4/y6Eq4='); $iv = base64_decode('rcFcdcgZ3Q/A+uHW'); $data = 'test'; $tag = null; $encrypted = openssl_encrypt($data,'aes-128-ccm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 8); var_dump(bin2hex($encrypted . $tag)); $encrypted = openssl_encrypt($data,'aes-192-ccm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 8); var_dump(bin2hex($encrypted . $tag)); $encrypted = openssl_encrypt($data,'aes-256-ccm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 8); var_dump(bin2hex($encrypted . $tag)); $encrypted = openssl_encrypt($data,'aes-128-gcm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 8); var_dump(bin2hex($encrypted . $tag)); $encrypted = openssl_encrypt($data,'aes-192-gcm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 8); var_dump(bin2hex($encrypted . $tag)); $encrypted = openssl_encrypt($data,'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv, $tag, "", 8); var_dump(bin2hex($encrypted . $tag)); */

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.10.0080.01016.80
8.5.00.0080.01220.21
8.4.150.0020.00114.05
8.4.140.0120.00817.72
8.4.130.0080.00218.02
8.4.120.0140.00620.50
8.4.110.0100.01022.44
8.4.100.0130.00817.80
8.4.90.0110.01018.50
8.4.80.0130.00818.12
8.4.70.0110.00817.93
8.4.60.0090.00118.53
8.4.50.0070.01319.73
8.4.40.0030.00619.48
8.4.30.0100.00017.65
8.4.20.0040.01919.66
8.4.10.0130.00319.82
8.3.280.0110.00918.38
8.3.270.0120.00916.50
8.3.260.0040.00516.44
8.3.250.0120.00718.73
8.3.240.0070.00316.81
8.3.230.0100.01016.82
8.3.220.0070.00916.96
8.3.210.0100.01016.63
8.3.200.0090.01016.58
8.3.190.0100.00917.05
8.3.180.0060.00316.59
8.3.170.0120.00619.20
8.3.160.0120.00616.77
8.3.150.0100.01318.94
8.3.140.0040.00418.93
8.3.130.0100.00018.41
8.3.120.0090.00620.61
8.3.110.0040.00420.39
8.3.100.0060.00316.80
8.3.90.0040.00416.70
8.3.80.0060.00317.97
8.3.70.0100.01018.56
8.3.60.0110.01116.50
8.3.50.0100.00618.15
8.3.40.0180.00018.74
8.3.30.0110.00418.67
8.3.20.0110.00721.66
8.3.10.0080.00021.92
8.3.00.0070.00021.87
8.2.290.0060.00220.54
8.2.280.0150.00420.05
8.2.270.0100.01016.65
8.2.260.0060.01216.44
8.2.250.0180.00018.26
8.2.240.0140.00717.18
8.2.230.0080.00020.94
8.2.220.0070.00424.06
8.2.210.0080.00026.77
8.2.200.0040.00416.63
8.2.190.0140.00016.88
8.2.180.0110.00716.75
8.2.170.0140.00322.96
8.2.160.0110.00419.21
8.2.150.0080.00024.18
8.2.140.0030.00724.66
8.2.130.0000.00819.32
8.2.120.0030.00626.35
8.2.110.0100.01021.04
8.2.100.0040.00817.78
8.2.90.0050.00319.09
8.2.80.0020.00517.97
8.2.70.0000.00817.46
8.2.60.0040.00417.92
8.2.50.0050.00218.10
8.2.40.0040.00420.59
8.2.30.0000.00819.27
8.2.20.0080.00018.04
8.2.10.0040.00417.95
8.2.00.0040.00418.15
8.1.330.0070.00420.25
8.1.320.0080.01116.00
8.1.310.0040.00416.38
8.1.300.0030.00618.11
8.1.290.0030.00630.84
8.1.280.0130.00625.92
8.1.270.0050.00322.00
8.1.260.0040.00426.35
8.1.250.0090.00628.09
8.1.240.0060.00322.67
8.1.230.0070.00417.64
8.1.220.0050.00317.75
8.1.210.0070.00318.77
8.1.200.0030.00617.35
8.1.190.0080.00017.23
8.1.180.0040.00418.10
8.1.170.0040.00418.61
8.1.160.0040.00418.86
8.1.150.0040.00418.83
8.1.140.0000.00719.13
8.1.130.0000.00717.54
8.1.120.0020.00517.26
8.1.110.0040.00317.39
8.1.100.0000.00717.42
8.1.90.0040.00417.42
8.1.80.0000.00717.29
8.1.70.0000.00717.41
8.1.60.0000.00917.41
8.1.50.0000.00917.52
8.1.40.0040.00417.51
8.1.30.0060.00317.57
8.1.20.0020.00517.51
8.1.10.0040.00417.63
8.1.00.0000.00817.37
8.0.300.0030.00618.77
8.0.290.0000.00816.75
8.0.280.0070.00018.29
8.0.270.0030.00617.18
8.0.260.0030.00617.20
8.0.250.0030.00516.83
8.0.240.0050.00316.94
8.0.230.0030.00316.81
8.0.220.0040.00416.84
8.0.210.0000.00816.86
8.0.200.0070.00016.92
8.0.190.0040.00416.99
8.0.180.0040.00416.96
8.0.170.0080.00016.93
8.0.160.0030.00316.84
8.0.150.0000.00816.83
8.0.140.0030.00316.80
8.0.130.0060.00013.24
8.0.120.0070.00016.83
8.0.110.0000.00916.82
8.0.100.0040.00416.80
8.0.90.0030.00516.76
8.0.80.0160.00316.93
8.0.70.0040.00416.81
8.0.60.0070.00016.70
8.0.50.0000.00816.88
8.0.30.0130.00916.98
8.0.20.0100.01017.40
8.0.10.0040.00416.98
8.0.00.0110.00716.75
7.4.330.0060.00015.55
7.4.320.0060.00016.43
7.4.300.0040.00416.48
7.4.290.0030.00316.41
7.4.280.0000.00716.45
7.4.270.0030.00316.45
7.4.260.0070.00016.34
7.4.250.0000.00816.51
7.4.240.0000.00716.57
7.4.230.0000.00716.61
7.4.220.0000.00816.62
7.4.210.0100.00416.59
7.4.200.0030.00316.53
7.4.160.0110.00716.46
7.4.150.0120.00917.40
7.4.140.0090.01117.86
7.4.130.0140.00716.62
7.4.120.0100.01116.39
7.4.110.0100.00716.40
7.4.100.0130.00316.41
7.4.90.0100.00716.51
7.4.80.0160.00619.39
7.4.70.0110.01116.27
7.4.60.0070.01016.43
7.4.50.0090.00316.73
7.4.40.0050.01116.66
7.4.10.0160.00314.75
7.4.00.0070.00914.90
7.3.330.0060.00013.01
7.3.320.0000.00513.09
7.3.310.0000.00716.20
7.3.300.0000.00616.12
7.3.290.0000.00716.28
7.3.280.0060.00816.26
7.3.270.0060.01617.40
7.3.260.0070.01116.33
7.3.250.0120.00516.35
7.3.240.0060.01216.51
7.3.230.0100.00616.48
7.3.210.0100.00716.34
7.3.200.0110.00816.55
7.3.190.0180.00316.17
7.3.180.0100.00716.30
7.3.170.0130.00316.37
7.3.160.0120.01116.56
7.3.130.0070.01015.06
7.3.120.0130.00314.52
7.3.110.0180.00014.92
7.3.100.0110.00714.84
7.3.90.0110.00714.77
7.3.80.0060.00614.79
7.3.70.0090.00614.72
7.3.60.0070.00714.67
7.3.50.0070.00714.51
7.3.40.0070.00714.76
7.3.30.0100.00314.85
7.3.20.0000.01416.76
7.3.10.0040.01116.56
7.3.00.0040.01216.62
7.2.330.0100.00716.36
7.2.320.0060.01216.47
7.2.310.0030.01316.63
7.2.300.0070.01016.31
7.2.290.0050.01316.63
7.2.260.0070.01114.92
7.2.250.0140.00415.14
7.2.240.0110.00314.87
7.2.230.0070.01015.09
7.2.220.0030.01414.90
7.2.210.0110.00714.63
7.2.200.0030.00915.12
7.2.190.0030.00615.07
7.2.180.0040.01114.99
7.2.170.0060.00914.84
7.2.160.0030.00714.70
7.2.150.0090.00316.89
7.2.140.0060.00916.72
7.2.130.0070.00716.68
7.2.120.0070.01116.96
7.2.110.0070.01016.89
7.2.100.0030.01316.91
7.2.90.0070.00716.57
7.2.80.0070.00716.96
7.2.70.0090.00616.80
7.2.60.0070.00616.91
7.2.50.0070.00316.86
7.2.40.0000.01016.77
7.2.30.0060.00916.87
7.2.20.0070.00716.91
7.2.10.0060.01017.02
7.2.00.0040.01418.21
7.1.330.0070.00715.42
7.1.320.0030.01315.79
7.1.310.0000.01415.81
7.1.300.0040.00715.75
7.1.290.0030.01215.73
7.1.280.0130.00315.60
7.1.270.0080.00315.69
7.1.260.0000.01015.75
7.1.250.0100.00315.64
7.1.240.0150.00015.65
7.1.230.0060.00615.67
7.1.220.0060.00915.54
7.1.210.0060.00615.80
7.1.200.0050.00515.61
7.1.190.0080.00415.69
7.1.180.0070.00715.74
7.1.170.0110.00415.63
7.1.160.0040.00815.80
7.1.150.0040.01115.72
7.1.140.0030.01015.71
7.1.130.0080.00815.61
7.1.120.0110.00316.92
7.1.110.0070.00616.88
7.1.100.0050.01116.67
7.1.90.0070.00416.77
7.1.80.0090.00516.85
7.1.70.0060.01116.45
7.1.60.0130.00825.28
7.1.50.0110.00625.21
7.1.40.0120.00625.03
7.1.30.0070.01325.16
7.1.20.0090.00925.12
7.1.10.0060.00816.19
7.1.00.0050.00816.11
7.0.330.0030.01415.18
7.0.320.0000.01515.47
7.0.310.0030.01015.27
7.0.300.0090.00615.19
7.0.290.0000.01115.28
7.0.280.0060.00615.46
7.0.270.0060.00915.04
7.0.260.0100.00315.28
7.0.250.0060.00615.41
7.0.240.0060.00615.48
7.0.230.0070.00415.46
7.0.220.0030.01015.14
7.0.210.0030.00915.38
7.0.200.0100.00715.38
7.0.190.0070.00415.34
7.0.180.0040.00815.44
7.0.170.0040.00715.40
7.0.160.0060.00915.34
7.0.150.0060.00915.33
7.0.140.0000.00815.48
7.0.130.0100.00315.44
7.0.120.0100.00315.23
7.0.110.0030.01015.23
7.0.100.0100.00315.18
7.0.90.0080.00415.43
7.0.80.0110.00715.27
7.0.70.0110.00715.22
7.0.60.0150.00315.41
7.0.50.0090.00315.61
7.0.40.0030.01313.41
7.0.30.0070.00713.38
7.0.20.0130.00313.28
7.0.10.0110.00013.16
7.0.00.0000.01513.46
5.6.400.0070.00714.09
5.6.390.0060.00614.49
5.6.380.0040.00814.21
5.6.370.0110.00314.19
5.6.360.0100.00714.23
5.6.350.0090.00314.19
5.6.340.0120.00314.15
5.6.330.0070.01014.01
5.6.320.0090.00313.88
5.6.310.0080.00814.37
5.6.300.0030.01414.38
5.6.290.0120.00014.60
5.6.280.0060.00814.31
5.6.270.0120.00314.14
5.6.260.0060.00613.90
5.6.250.0100.00013.95
5.6.240.0000.01514.09
5.6.230.0080.00414.15
5.6.220.0030.01114.33
5.6.210.0000.01414.20
5.6.200.0170.00014.09
5.6.190.0120.00314.41
5.6.180.0100.00314.19
5.6.170.0100.00314.08
5.6.160.0060.00914.01
5.6.150.0090.00914.12
5.6.140.0060.01214.20
5.6.130.0090.00313.98
5.6.120.0030.01014.34
5.6.110.0050.00414.29
5.6.100.0070.00413.99
5.6.90.0030.00914.10
5.6.80.0040.01214.16
5.6.70.0070.00714.05
5.6.60.0070.00714.02
5.6.50.0110.00414.12
5.6.40.0090.00613.93
5.6.30.0040.00814.42
5.6.20.0000.01014.01
5.6.10.0060.00314.04
5.6.00.0060.00614.14

preferences:
33.2 ms | 403 KiB | 5 Q