3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_index = 6; $move_to = $current_index + 2; $last_index = 11; if ($move_to > $last_index) { $move_to = ($move_to % $last_index) - 1; } echo $move_to;

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.0110.00418.25
8.3.50.0140.00717.76
8.3.40.0100.01018.51
8.3.30.0140.00718.50
8.3.20.0000.00721.73
8.3.10.0080.00023.65
8.3.00.0020.00523.65
8.2.180.0070.01418.31
8.2.170.0070.00722.96
8.2.160.0110.00320.46
8.2.150.0000.00824.18
8.2.140.0000.00724.66
8.2.130.0040.00419.60
8.2.120.0040.00426.35
8.2.110.0050.00522.13
8.2.100.0060.00617.78
8.2.90.0120.00017.50
8.2.80.0000.00917.97
8.2.70.0080.00018.03
8.2.60.0050.00318.09
8.2.50.0040.00418.10
8.2.40.0000.00719.30
8.2.30.0000.00719.11
8.2.20.0050.00219.84
8.2.10.0050.00219.30
8.2.00.0000.00819.27
8.1.280.0070.00725.92
8.1.270.0000.00818.77
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0080.00022.46
8.1.230.0040.00817.69
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0060.00317.10
8.1.190.0080.00020.07
8.1.180.0050.00318.10
8.1.170.0050.00318.64
8.1.160.0080.00018.86
8.1.150.0050.00218.69
8.1.140.0000.00823.93
8.1.130.0000.00719.98
8.1.120.0050.00317.26
8.1.110.0030.00517.30
8.1.100.0000.00717.40
8.1.90.0030.00317.39
8.1.80.0050.00317.35
8.1.70.0030.00317.38
8.1.60.0060.00317.54
8.1.50.0040.00717.33
8.1.40.0000.00717.48
8.1.30.0030.00517.60
8.1.20.0060.00317.49
8.1.10.0040.00417.55
8.1.00.0060.00317.42
8.0.300.0070.00018.77
8.0.290.0060.00316.75
8.0.280.0000.00718.35
8.0.270.0000.00717.15
8.0.260.0060.00018.36
8.0.250.0030.00316.97
8.0.240.0030.00316.95
8.0.230.0040.00416.77
8.0.220.0050.00216.78
8.0.210.0030.00516.86
8.0.200.0000.00616.79
8.0.190.0000.00716.89
8.0.180.0050.00316.76
8.0.170.0040.00416.77
8.0.160.0000.00716.80
8.0.150.0030.00316.81
8.0.140.0040.00416.75
8.0.130.0030.00313.28
8.0.120.0000.00716.79
8.0.110.0000.00716.78
8.0.100.0050.00216.70
8.0.90.0000.00716.86
8.0.80.0000.01716.78
8.0.70.0050.00216.85
8.0.60.0030.00516.88
8.0.50.0000.00816.86
8.0.30.0090.00917.03
8.0.20.0080.01116.93
8.0.10.0040.00416.98
8.0.00.0110.00716.78
7.4.330.0000.00515.55
7.4.320.0000.00716.44
7.4.300.0000.00616.53
7.4.290.0070.00016.48
7.4.280.0000.00816.35
7.4.270.0060.00016.54
7.4.260.0000.00716.37
7.4.250.0070.00016.38
7.4.240.0040.00416.45
7.4.230.0030.00316.46
7.4.220.0040.00416.26
7.4.210.0080.00716.51
7.4.200.0000.00716.48
7.4.160.0070.01116.42
7.4.140.0110.00717.86
7.4.130.0170.00716.30
7.4.120.0090.01516.52
7.4.110.0070.01016.36
7.4.100.0100.00916.32
7.4.90.0040.01616.32
7.4.80.0120.01219.39
7.4.70.0070.01016.50
7.4.60.0060.00916.58
7.4.50.0070.01016.31
7.4.40.0130.01016.50
7.4.00.0030.01514.70
7.3.330.0000.00513.11
7.3.320.0030.00313.03
7.3.310.0030.00316.21
7.3.300.0060.00016.25
7.3.290.0050.00216.18
7.3.280.0120.00716.18
7.3.260.0080.00816.36
7.3.240.0090.01016.27
7.3.230.0090.00616.48
7.3.210.0130.00316.13
7.3.200.0070.01316.10
7.3.190.0030.01816.19
7.3.180.0100.00716.35
7.3.170.0090.01316.40
7.3.160.0150.00316.30
7.3.00.4180.00714.16
7.2.330.0040.01516.66
7.2.320.0100.00716.73
7.2.310.0000.01516.60
7.2.300.0100.00716.51
7.2.290.0100.01016.63
7.2.130.3870.01314.25
7.2.120.4600.00314.27
7.2.110.2960.00314.24
7.2.100.0110.00414.44
7.2.90.0260.00714.39
7.2.80.0090.00614.05
7.2.70.5300.01014.61
7.2.60.6190.00014.50
7.2.50.6160.00714.74
7.2.40.5900.01315.02
7.2.30.5200.00315.02
7.2.20.4220.01014.68
7.2.10.3410.01015.07
7.2.00.2950.00014.43
7.1.250.4070.00713.60
7.0.330.3790.00313.33
5.6.380.0070.00714.27

preferences:
60.78 ms | 400 KiB | 5 Q