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 'ddd' . $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.60.0060.00918.27
8.3.50.0120.00620.14
8.3.40.0090.00619.58
8.3.30.0070.00718.72
8.3.20.0000.00724.18
8.3.10.0070.00024.66
8.3.00.0050.00326.16
8.2.180.0100.00625.92
8.2.170.0180.00318.75
8.2.160.0100.00322.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00426.16
8.2.110.0050.00520.52
8.2.100.0090.00317.91
8.2.90.0040.00417.50
8.2.80.0040.00418.61
8.2.70.0040.00417.25
8.2.60.0040.00417.50
8.2.50.0040.00418.04
8.2.40.0000.00718.22
8.2.30.0050.00317.94
8.2.20.0030.00519.24
8.2.10.0070.00018.12
8.2.00.0000.00719.19
8.1.280.0170.00025.92
8.1.270.0050.00224.66
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0070.01122.01
8.1.230.0060.00620.95
8.1.220.0000.00718.54
8.1.210.0000.00818.77
8.1.200.0080.00017.48
8.1.190.0000.00917.23
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0000.00818.98
8.1.150.0050.00218.57
8.1.140.0000.00717.39
8.1.130.0030.00319.07
8.1.120.0000.00717.43
8.1.110.0000.00717.45
8.1.100.0000.00717.38
8.1.90.0110.00717.45
8.1.80.0000.01617.34
8.1.70.0100.00617.29
8.1.60.0150.00317.57
8.1.50.0110.00717.50
8.1.40.0150.00417.42
8.1.30.0190.00017.54
8.1.20.0150.00417.51
8.1.10.0090.00917.35
8.1.00.0060.01217.40
8.0.300.0040.00718.77
8.0.290.0030.00516.75
8.0.280.0070.00018.30
8.0.270.0030.00316.66
8.0.260.0000.00718.38
8.0.250.0000.00716.89
8.0.240.0030.00316.89
8.0.230.0070.00016.87
8.0.220.0070.00716.85
8.0.210.0120.00316.70
8.0.200.0050.01116.75
8.0.190.0000.01516.75
8.0.180.0120.00216.80
8.0.170.0060.01016.92
8.0.160.0070.00716.84
8.0.150.0110.00416.74
8.0.140.0120.00316.78
8.0.130.0150.00016.84
8.0.120.0130.00316.81
8.0.110.0170.00016.81
8.0.100.0120.00416.68
8.0.90.0110.00316.76
8.0.80.0030.00616.82
8.0.70.0100.00316.77
8.0.60.0030.00716.71
8.0.50.0060.00616.67
8.0.30.0070.00716.70
8.0.20.0090.00416.72
8.0.10.0080.00416.81
7.4.330.0060.00015.55
7.4.320.0030.00316.58
7.4.300.0130.00416.54
7.4.290.0140.00016.36
7.4.280.0130.00316.47
7.4.270.0100.00716.60
7.4.260.0160.00016.37
7.4.250.0180.00016.47
7.4.240.0130.00416.60
7.4.230.0040.00716.38
7.4.220.0090.00316.44
7.4.210.0030.00616.60
7.4.200.0050.00516.47
7.4.190.0030.01016.63
7.4.180.0070.00216.65
7.4.160.0050.00516.44
7.4.150.0040.00716.48
7.4.140.0120.00016.37
7.4.130.0110.00016.39
7.4.120.0080.00316.39
7.4.110.0070.00416.14
7.4.100.0060.00516.46
7.4.90.0100.00016.46
7.4.80.0070.00416.26
7.4.70.0030.00616.15
7.4.60.0040.00516.46
7.4.50.0100.00016.20
7.4.40.0000.00916.08
7.4.30.0110.00016.37
7.4.20.0060.00316.25
7.4.10.0050.00316.00
7.4.00.0040.00416.27

preferences:
44.3 ms | 401 KiB | 5 Q