3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [0, 1, 2, 3, 4, 5, 6, 7]; $count = count($a); $span = 5; // most sensible with odd numbers $center = (int)($span / 2); foreach ($a as $i => $v) { printf( "%d: %s\n", $i, implode( ',', array_slice( $a, min($count - $span, max(0, $i - $center)), $span ) ) ); }

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.4.120.0110.00923.92
8.4.110.0130.00718.79
8.4.100.0180.00318.80
8.4.90.0120.00820.34
8.4.80.0120.00817.59
8.4.70.0080.00717.45
8.4.60.0110.00418.82
8.4.50.0080.01019.44
8.4.40.0120.00919.13
8.4.30.0060.01318.31
8.4.20.0050.00317.98
8.4.10.0070.01121.88
8.3.250.0120.00818.75
8.3.240.0070.01017.29
8.3.230.0100.01116.50
8.3.220.0070.00317.26
8.3.210.0110.00916.73
8.3.200.0040.00516.60
8.3.190.0060.01217.02
8.3.180.0130.00616.41
8.3.170.0090.00919.09
8.3.160.0110.00718.18
8.3.150.0070.01118.83
8.3.140.0050.00316.78
8.3.130.0060.00318.58
8.3.120.0070.00318.85
8.3.110.0070.01120.94
8.3.100.0050.00318.22
8.3.90.0050.00326.77
8.3.80.0060.00316.50
8.3.70.0180.00316.63
8.3.60.0110.00718.18
8.3.50.0090.00620.03
8.3.40.0150.00418.51
8.3.30.0120.00918.95
8.3.20.0080.00024.18
8.3.10.0070.00024.66
8.3.00.0060.00926.16
8.2.290.0100.00420.37
8.2.280.0060.00518.66
8.2.270.0160.00317.07
8.2.260.0090.00016.38
8.2.250.0120.00616.87
8.2.240.0120.00317.00
8.2.230.0070.00422.58
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0060.00316.38
8.2.190.0150.00616.58
8.2.180.0110.00325.92
8.2.170.0160.00318.70
8.2.160.0100.01022.96
8.2.150.0030.00625.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00426.16
8.2.110.0070.00420.93
8.2.100.0120.00017.84
8.2.90.0080.00017.91
8.2.80.0050.00319.12
8.2.70.0080.00017.50
8.2.60.0040.00417.50
8.2.50.0000.00817.98
8.2.40.0080.00018.22
8.2.30.0040.00417.99
8.2.20.0000.00720.38
8.2.10.0040.00418.13
8.2.00.0000.00919.23
8.1.330.0100.00321.86
8.1.320.0140.00617.96
8.1.310.0090.00916.58
8.1.300.0110.00418.45
8.1.290.0090.00030.84
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00322.16
8.1.230.0070.00420.97
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0030.00717.23
8.1.180.0060.00318.10
8.1.170.0040.00417.62
8.1.160.0060.00318.88
8.1.150.0040.00418.62
8.1.140.0040.00417.35
8.1.130.0000.00918.89
8.1.120.0070.00017.48
8.1.110.0030.00517.51
8.1.100.0050.00317.42
8.1.90.0000.00717.49
8.1.80.0100.00017.52
8.1.70.0000.00717.39
8.1.60.0000.00817.66
8.1.50.0190.00617.46
8.1.40.0080.00817.52
8.1.30.0100.00417.61
8.1.20.0080.00517.52
8.1.10.0050.00717.49
8.1.00.0080.00517.33
8.0.300.0080.00020.14
8.0.290.0040.00416.75
8.0.280.0070.00018.41
8.0.270.0030.00316.80
8.0.260.0040.00418.46
8.0.250.0030.00316.95
8.0.240.0030.00316.98
8.0.230.0000.00716.95
8.0.220.0000.00816.95
8.0.210.0030.00316.89
8.0.200.0030.00516.97
8.0.190.0080.00016.84
8.0.180.0080.00516.85
8.0.170.0040.00916.90
8.0.160.0070.00516.74
8.0.150.0070.00516.81
8.0.140.0170.00316.81
8.0.130.0130.00516.86
8.0.120.0170.00216.80
8.0.110.0150.00516.89
8.0.100.0130.00516.79
8.0.90.0110.00916.86
8.0.80.0120.00816.91
8.0.70.0150.00416.76
8.0.60.0170.00416.73
8.0.50.0110.00816.82
8.0.30.0170.00416.90
8.0.20.0110.00616.86
8.0.10.0100.00616.98
7.4.330.0060.00015.55
7.4.320.0000.00716.43
7.4.300.0060.00016.55
7.4.290.0080.00316.54
7.4.280.0040.00716.39
7.4.270.0050.00516.61
7.4.260.0080.00316.60
7.4.250.0050.00516.56
7.4.240.0080.00416.53
7.4.230.0110.00316.47
7.4.220.0130.00316.53
7.4.210.0190.00016.43
7.4.200.0110.00416.45
7.4.190.0100.00816.56
7.4.180.0160.00516.54
7.4.160.0140.00716.54
7.4.150.0190.00316.49
7.4.140.0130.00516.44
7.4.130.0110.00516.38
7.4.120.0060.00616.41
7.4.110.0160.00116.35
7.4.100.0170.00216.49
7.4.90.0160.00316.49
7.4.80.0190.00316.51
7.4.70.0160.00316.34
7.4.60.0160.00516.46
7.4.50.0170.00316.41
7.4.40.0130.00716.32
7.4.30.0100.00616.41
7.4.20.0140.00316.47
7.4.10.0160.00216.37
7.4.00.0120.00616.35

preferences:
103.49 ms | 403 KiB | 5 Q