3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 2, 3, 4, 3, 2, 1]; $j = count($a) - 1; $output = []; for($i = 0; $i > count($a); $i++) { echo $a[$i] ." ". $a[$j]; if ($a[$i] !== $a[$j]) { $output = $a[$i]; } $j--; } print_r($output);

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.0040.01119.66
8.3.30.0110.00418.48
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.170.0110.00418.79
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0020.00526.16
8.2.110.0030.00620.52
8.2.100.0100.00017.57
8.2.90.0040.00417.63
8.2.80.0090.00018.83
8.2.70.0080.00017.63
8.2.60.0000.00817.50
8.2.50.0080.00018.04
8.2.40.0070.00018.09
8.2.30.0040.00417.95
8.2.20.0030.00319.25
8.2.10.0050.00218.16
8.2.00.0050.00319.34
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.86
8.1.230.0070.00320.91
8.1.220.0040.00418.64
8.1.210.0050.00318.77
8.1.200.0000.00817.35
8.1.190.0030.00617.11
8.1.180.0050.00318.10
8.1.170.0050.00317.62
8.1.160.0050.00519.00
8.1.150.0040.00418.65
8.1.140.0040.00417.36
8.1.130.0030.00319.02
8.1.120.0040.00417.49
8.1.110.0040.00417.37
8.1.100.0040.00417.41
8.1.90.0050.01017.41
8.1.80.0150.00017.43
8.1.70.0150.00017.27
8.1.60.0060.01217.59
8.1.50.0140.00317.47
8.1.40.0050.01417.39
8.1.30.0050.01417.50
8.1.20.0150.00317.61
8.1.10.0100.00717.32
8.1.00.0060.01117.30
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0000.00818.30
8.0.270.0000.00716.82
8.0.260.0030.00318.25
8.0.250.0030.00316.88
8.0.240.0030.00316.85
8.0.230.0000.00716.87
8.0.220.0110.00316.69
8.0.210.0050.01016.74
8.0.200.0120.00416.79
8.0.190.0100.00516.85
8.0.180.0070.00716.88
8.0.170.0040.01116.88
8.0.160.0040.01416.96
8.0.150.0100.00616.86
8.0.140.0100.00516.82
8.0.130.0110.00416.68
8.0.120.0040.01216.81
8.0.110.0100.00516.81
8.0.100.0110.00416.74
8.0.90.0130.00016.79
8.0.80.0050.00516.86
8.0.70.0060.00616.77
8.0.60.0050.00616.70
8.0.50.0100.00316.87
8.0.30.0040.01016.81
8.0.20.0080.00416.64
8.0.10.0060.00617.01
7.4.330.0060.00015.55
7.4.320.0000.00616.57
7.4.300.0080.00816.59
7.4.290.0080.00616.43
7.4.280.0150.00316.61
7.4.270.0090.00616.37
7.4.260.0170.00016.57
7.4.250.0080.00916.47
7.4.240.0080.00416.55
7.4.230.0070.00416.47
7.4.220.0140.00016.47
7.4.210.0070.00316.46
7.4.200.0050.00516.56
7.4.190.0060.00716.62
7.4.180.0050.00516.47
7.4.160.0060.00316.46
7.4.150.0080.00316.49
7.4.140.0110.00316.30
7.4.130.0080.00316.21
7.4.120.0050.00716.37
7.4.110.0090.00216.19
7.4.100.0120.00016.55
7.4.90.0040.00716.57
7.4.80.0060.00616.29
7.4.70.0050.00516.27
7.4.60.0030.00616.28
7.4.50.0110.00016.13
7.4.40.0090.00016.13
7.4.30.0050.00516.47
7.4.20.0000.01016.25
7.4.10.0040.00415.90
7.4.00.0000.00816.36

preferences:
41.13 ms | 400 KiB | 5 Q