3v4l.org

run code in 300+ PHP versions simultaneously
<?php function aesCtr(string $m, string $n, string $k): string { return \openssl_encrypt($m, 'aes-256-ctr', $k, OPENSSL_RAW_DATA, $n); } $messages = [ 'wGVEtlgIETc4E4SNly0b7viJAv3bpO/85lC5/XCssVnMlrPc+TxeI+Jrsl+wVwQVOKbCEw8=', '2GxE9VRBC3giH5XMiSQXvfnGAeGHBqlXABl1mHrcabUCi8PLNlZCe+K1+3M9Vvb9nJo0AjHjuYkARV9h8WRywgFg+VSWKLb0K0lg+ZBVN70sJ+GRLrB6mCUK/ZeYucA=', '1mgX9w0TFzd2Ty69vfYaKmioBx7KaZoHHuCYCOEG519T2EQs6HJMIIle' ]; $key = hash('sha256', 'spottycat', true); $nonce = str_repeat("\0", 16); // First, remove the base64 decoding: $base64decoded = [ base64_decode($messages[0]), base64_decode($messages[1]), base64_decode($messages[2]) ]; // The last 32 bytes are a HMAC. We can strip that. $stripLast32 = [ mb_substr($base64decoded[0], 0, -32, '8bit'), mb_substr($base64decoded[1], 0, -32, '8bit'), mb_substr($base64decoded[2], 0, -32, '8bit') ]; var_dump( bin2hex($stripLast32[0]), bin2hex($stripLast32[1]), bin2hex($stripLast32[2]), bin2hex( aesCtr($messages[0], $nonce, $key) ), bin2hex( aesCtr($messages[1], $nonce, $key) ), bin2hex( aesCtr($messages[2], $nonce, $key) ), aesCtr($messages[0], $nonce, $key), aesCtr($messages[1], $nonce, $key), aesCtr($messages[2], $nonce, $key) );

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.0060.00916.63
8.3.50.0110.01118.09
8.3.40.0120.00318.70
8.3.30.0160.00318.75
8.3.20.0070.00020.36
8.3.10.0030.00623.60
8.3.00.0050.00323.61
8.2.180.0040.01218.66
8.2.170.0140.00319.04
8.2.160.0130.00722.96
8.2.150.0080.00025.66
8.2.140.0000.00724.66
8.2.130.0030.00520.32
8.2.120.0000.00826.35
8.2.110.0030.00622.16
8.2.100.0110.00017.86
8.2.90.0040.00420.71
8.2.80.0030.00518.04
8.2.70.0050.00318.16
8.2.60.0040.00418.16
8.2.50.0080.00018.22
8.2.40.0030.00520.29
8.2.30.0070.00021.02
8.2.20.0030.00618.05
8.2.10.0040.00418.27
8.2.00.0070.00018.25
8.1.280.0110.00425.92
8.1.270.0060.00322.05
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00021.06
8.1.230.0040.00820.95
8.1.220.0040.00417.74
8.1.210.0040.00418.78
8.1.200.0100.00017.36
8.1.190.0060.00317.22
8.1.180.0080.00018.10
8.1.170.0040.00418.49
8.1.160.0040.00418.98
8.1.150.0070.00020.22
8.1.140.0000.00719.17
8.1.130.0090.00018.97
8.1.120.0030.00517.41
8.1.110.0000.00717.50
8.1.100.0050.00317.39
8.1.90.0000.00817.43
8.1.80.0040.00417.39
8.1.70.0070.00017.55
8.1.60.0080.00017.73
8.1.50.0090.00017.47
8.1.40.0030.00617.71
8.1.30.0060.00317.60
8.1.20.0040.00417.72
8.1.10.0030.00517.64
8.1.00.0040.00417.53
8.0.300.0040.00420.20
8.0.290.0050.00317.13
8.0.280.0070.00018.59
8.0.270.0040.00417.32
8.0.260.0000.00820.36
8.0.250.0070.00017.17
8.0.240.0030.00717.10
8.0.230.0080.00017.13
8.0.220.0030.00316.96
8.0.210.0040.00417.10
8.0.200.0060.00017.04
8.0.190.0040.00417.04
8.0.180.0000.00716.97
8.0.170.0040.00417.13
8.0.160.0070.00017.11
8.0.150.0070.00317.09
8.0.140.0070.00416.91
8.0.130.0000.00513.53
8.0.120.0080.00016.94
8.0.110.0030.00516.89
8.0.100.0000.00817.05
8.0.90.0040.00417.11
8.0.80.0140.00617.07
8.0.70.0070.00017.10
8.0.60.0000.00716.95
8.0.50.0060.00317.02
8.0.30.0110.00717.27
8.0.20.0120.00717.43
8.0.10.0040.00416.99
8.0.00.0130.00716.73
7.4.330.0000.00715.55
7.4.320.0060.00016.56
7.4.300.0070.00016.65
7.4.290.0030.00316.44
7.4.280.0040.00416.62
7.4.270.0000.00816.66
7.4.260.0000.00716.50
7.4.250.0000.00716.40
7.4.240.0040.00416.60
7.4.230.0000.00716.48
7.4.220.0110.00716.45
7.4.210.0000.00016.49
7.4.200.0000.00716.58
7.4.160.0060.01016.61
7.4.150.0140.00317.40
7.4.140.0090.00817.86
7.4.130.0100.01316.71
7.4.120.0140.01216.75
7.4.110.0120.00916.67
7.4.100.0070.01116.59
7.4.90.0080.01116.64
7.4.80.0070.01019.39
7.4.70.0040.01416.58
7.4.60.0100.00616.44
7.4.50.0090.00316.56
7.4.40.0090.01216.51
7.4.30.0070.01316.62
7.4.00.0060.00314.71
7.3.330.0020.00213.40
7.3.320.0000.00613.25
7.3.310.0030.00316.33
7.3.300.0030.00316.25
7.3.290.0040.01216.33
7.3.280.0110.00616.34
7.3.270.0140.00317.40
7.3.260.0090.01116.52
7.3.250.0110.00616.46
7.3.240.0120.00516.44
7.3.230.0170.00016.59
7.3.210.0100.01316.64
7.3.200.0100.00716.40
7.3.190.0060.01016.47
7.3.180.0030.01616.65
7.3.170.0070.01016.37
7.3.160.0040.01316.34
7.2.330.0070.01016.71
7.2.320.0100.00716.77
7.2.310.0100.01116.78
7.2.300.0060.01316.68
7.2.290.0080.00816.80
7.2.60.0070.00716.91
7.2.50.0030.01016.91
7.1.200.0000.01115.82
7.1.110.1060.00916.19
7.1.100.0050.01017.80
7.1.90.0040.01118.38
7.1.80.0140.00618.07
7.1.70.0070.00717.27
7.1.60.0250.00335.30
7.1.50.0240.00334.67
7.1.40.0270.00734.66
7.1.30.0160.01634.75
7.1.20.0230.01434.89
7.1.10.0030.01316.72
7.1.00.0000.01817.01
7.0.250.1000.01015.52
7.0.240.0050.00917.46
7.0.230.0100.01017.61
7.0.220.0070.00717.52
7.0.210.0000.01316.45
7.0.200.0060.00616.63
7.0.190.0080.00416.78
7.0.180.0030.01516.41
7.0.170.0150.00316.53
7.0.160.0090.00916.30
7.0.150.0100.00616.30
7.0.140.0030.01316.59
7.0.130.0080.00816.53
7.0.120.0030.01416.82
7.0.110.0000.01816.34
7.0.100.0090.00916.53
7.0.90.0090.00616.47
7.0.80.0060.01316.50
7.0.70.0070.00716.43
7.0.60.0080.01116.30
7.0.50.0040.01516.32
7.0.40.0060.01216.59
7.0.30.0030.01416.44
7.0.20.0030.01216.24
7.0.10.0080.00816.55
7.0.00.0040.01116.51

preferences:
65.41 ms | 400 KiB | 5 Q