3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_index = 8; $move_to = $current_index + 5; $last_index = 12; 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.0160.00318.31
8.3.50.0060.00917.90
8.3.40.0110.00818.72
8.3.30.0100.01018.60
8.3.20.0080.00021.77
8.3.10.0050.00323.48
8.3.00.0000.00723.53
8.2.180.0160.00316.38
8.2.170.0000.01522.96
8.2.160.0070.00720.48
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0040.00418.03
8.2.120.0000.00726.35
8.2.110.0030.00621.94
8.2.100.0070.00417.72
8.2.90.0060.00317.75
8.2.80.0060.00317.97
8.2.70.0050.00317.77
8.2.60.0040.00418.22
8.2.50.0080.00018.10
8.2.40.0030.00619.47
8.2.30.0060.00319.23
8.2.20.0080.00019.91
8.2.10.0070.00019.40
8.2.00.0000.00819.31
8.1.280.0070.00725.92
8.1.270.0080.00818.80
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00322.47
8.1.230.0130.00017.64
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.36
8.1.190.0070.00320.24
8.1.180.0000.00818.10
8.1.170.0030.00618.65
8.1.160.0050.00318.82
8.1.150.0040.00418.83
8.1.140.0030.00422.11
8.1.130.0000.00720.00
8.1.120.0000.00717.29
8.1.110.0000.00917.41
8.1.100.0040.00417.39
8.1.90.0030.00517.36
8.1.80.0040.00417.41
8.1.70.0050.00317.40
8.1.60.0080.00017.51
8.1.50.0000.01117.43
8.1.40.0040.00417.41
8.1.30.0080.00017.51
8.1.20.0000.00717.57
8.1.10.0040.00417.52
8.1.00.0000.00717.48
8.0.300.0040.00419.59
8.0.290.0040.00416.58
8.0.280.0000.00718.30
8.0.270.0000.00717.12
8.0.260.0060.00018.49
8.0.250.0000.00816.91
8.0.240.0000.00616.86
8.0.230.0000.00716.92
8.0.220.0040.00416.79
8.0.210.0040.00416.74
8.0.200.0070.00016.87
8.0.190.0050.00216.98
8.0.180.0080.00016.89
8.0.170.0000.00916.77
8.0.160.0030.00516.93
8.0.150.0040.00416.79
8.0.140.0030.00516.85
8.0.130.0070.00013.27
8.0.120.0000.00716.84
8.0.110.0040.00416.83
8.0.100.0030.00516.88
8.0.90.0040.00416.92
8.0.80.0060.01016.82
8.0.70.0040.00416.88
8.0.60.0030.00516.84
8.0.50.0000.00716.67
8.0.30.0080.01016.95
8.0.20.0070.01117.21
8.0.10.0030.00317.01
8.0.00.0100.00816.64
7.4.330.0000.00615.55
7.4.320.0060.00016.29
7.4.300.0000.00616.28
7.4.290.0000.00816.50
7.4.280.0050.00316.56
7.4.270.0030.00316.57
7.4.260.0030.00316.32
7.4.250.0070.00016.48
7.4.240.0080.00016.45
7.4.230.0070.00016.60
7.4.220.0050.00216.42
7.4.210.0080.00716.56
7.4.200.0000.00716.32
7.4.160.0100.00816.43
7.4.140.0110.00817.86
7.4.130.0150.00416.36
7.4.120.0100.00716.52
7.4.110.0140.00316.59
7.4.100.0100.01316.32
7.4.90.0210.00316.59
7.4.80.0140.00519.39
7.4.70.0130.01016.47
7.4.60.0030.01316.36
7.4.50.0110.00816.32
7.4.40.0120.00816.38
7.4.00.0080.00814.96
7.3.330.0000.00513.12
7.3.320.0050.00013.13
7.3.310.0000.00716.10
7.3.300.0000.00716.25
7.3.290.0000.00716.25
7.3.280.0100.00516.29
7.3.260.0110.00616.42
7.3.240.0100.00616.39
7.3.230.0140.00316.44
7.3.210.0130.00316.54
7.3.200.0100.00716.26
7.3.190.0130.00616.29
7.3.180.0110.00616.25
7.3.170.0130.01016.26
7.3.160.0080.00816.27
7.3.00.1540.00614.24
7.2.330.0120.00616.38
7.2.320.0130.01016.51
7.2.310.0030.01316.52
7.2.300.0120.00916.66
7.2.290.0060.01316.38
7.2.130.1590.01014.52
7.2.120.1560.01014.73
7.2.110.1800.00714.63
7.2.100.1860.00714.42
7.2.90.1740.00714.64
7.2.80.2800.00314.86
7.2.70.2680.00715.19
7.2.60.4070.00714.54
7.2.50.2860.00714.89
7.2.40.3070.00714.78
7.2.30.2820.01414.63
7.2.20.1240.01314.49
7.2.10.4690.00714.54
7.2.00.3880.00714.62
7.1.250.2410.00613.97
7.0.330.1610.00713.25
5.6.380.0110.00714.06

preferences:
62.26 ms | 401 KiB | 5 Q