3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ids = [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110]; $users = [1,2,3,4,5]; // Temporary copy of users $user_ids = []; foreach( $ids as $id ){ // If our copy is empty, reload it if(!$user_ids){ $user_ids = $users; } // Use array_shift() to grab and remove from the front echo sprintf('%1$d - %2$d', $id, array_shift($user_ids)), PHP_EOL; } echo PHP_EOL; foreach( $ids as $idx => $id ){ echo sprintf('%1$d - %2$d', $id, ($idx % 5) + 1 ), PHP_EOL; }

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.0150.00424.05
8.4.110.0110.00619.15
8.4.100.0130.01117.54
8.4.90.0130.00717.67
8.4.80.0060.00321.16
8.4.70.0100.00819.50
8.4.60.0060.00319.47
8.4.50.0110.00919.07
8.4.40.0120.00919.48
8.4.30.0130.01320.11
8.4.20.0130.00617.82
8.4.10.0000.01026.06
8.3.250.0120.00719.07
8.3.240.0080.01017.18
8.3.230.0120.00816.34
8.3.220.0110.00818.84
8.3.210.0150.00316.53
8.3.200.0110.00916.44
8.3.190.0110.00917.04
8.3.180.0060.00216.74
8.3.170.0080.00316.50
8.3.160.0060.01218.32
8.3.150.0110.00016.18
8.3.140.0090.00916.99
8.3.130.0060.00318.61
8.3.120.0000.00918.61
8.3.110.0040.00420.94
8.3.100.0070.01424.06
8.3.90.0060.00326.77
8.3.80.0090.00018.55
8.3.70.0100.00716.58
8.3.60.0070.01018.30
8.3.50.0110.00618.31
8.3.40.0070.00718.71
8.3.30.0090.00618.95
8.3.20.0070.00024.18
8.3.10.0130.00724.66
8.3.00.0040.00426.16
8.2.290.0070.00320.63
8.2.280.0160.00519.99
8.2.270.0150.00416.64
8.2.260.0120.00316.69
8.2.250.0090.00616.58
8.2.240.0060.00317.12
8.2.230.0090.00022.58
8.2.220.0030.00637.54
8.2.210.0140.00726.77
8.2.200.0090.00316.63
8.2.190.0060.01316.60
8.2.180.0110.00725.92
8.2.170.0130.00718.91
8.2.160.0100.00322.96
8.2.150.0000.00725.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0080.00021.05
8.2.110.0030.00621.12
8.2.100.0320.00517.29
8.2.90.0000.00817.63
8.2.80.0050.00318.84
8.2.70.0030.00917.63
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0040.00418.16
8.2.30.0040.00418.13
8.2.20.0000.00720.31
8.2.10.0000.00718.00
8.2.00.0000.00719.29
8.1.330.0130.00516.61
8.1.320.0110.00816.00
8.1.310.0130.00616.28
8.1.300.0030.00619.98
8.1.290.0070.00330.84
8.1.280.0040.01125.92
8.1.270.0040.00423.86
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00619.61
8.1.230.0110.00017.70
8.1.220.0060.00317.78
8.1.210.0000.00818.77
8.1.200.0060.00617.34
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0030.00618.34
8.1.160.0040.00418.90
8.1.150.0000.00918.68
8.1.140.0000.00717.50
8.1.130.0070.00018.78
8.1.120.0000.00717.45
8.1.110.0030.00517.41
8.1.100.0000.00717.47
8.1.90.0000.00717.38
8.1.80.0000.00817.36
8.1.70.0030.00317.41
8.1.60.0040.00417.48
8.1.50.0240.00317.44
8.1.40.0110.01517.32
8.1.30.0170.00817.42
8.1.20.0140.00617.40
8.1.10.0130.00417.39
8.1.00.0100.00517.36
8.0.300.0040.00418.77
8.0.290.0070.00416.75
8.0.280.0000.00720.15
8.0.270.0040.00418.03
8.0.260.0030.00318.31
8.0.250.0000.00716.91
8.0.240.0030.00316.97
8.0.230.0040.00416.93
8.0.220.0000.00816.91
8.0.210.0030.00316.91
8.0.200.0050.00316.98
8.0.190.0000.00816.86
8.0.180.0030.00616.85
8.0.170.0160.00416.60
8.0.160.0090.00616.83
8.0.150.0130.00316.82
8.0.140.0160.00316.82
8.0.130.0180.00416.72
8.0.120.0170.00316.79
8.0.110.0120.00416.63
8.0.100.0080.00416.63
8.0.90.0070.01116.67
8.0.80.0100.00516.71
8.0.70.0150.00316.70
8.0.60.0120.00816.60
8.0.50.0150.00616.89
8.0.30.0180.00516.78
8.0.20.0200.00316.91
8.0.10.0140.00816.79
7.4.330.0030.00315.55
7.4.320.0000.00716.43
7.4.300.0070.00016.50
7.4.290.0040.00816.55
7.4.280.0190.00616.35
7.4.270.0190.00616.53
7.4.260.0210.00416.44
7.4.250.0220.00416.51
7.4.240.0160.00516.41
7.4.230.0210.00316.35
7.4.220.0160.00516.43
7.4.210.0120.00816.50
7.4.200.0150.00616.41
7.4.190.0180.00416.64
7.4.180.0210.00016.32
7.4.160.0150.00616.59
7.4.150.0120.00816.53
7.4.140.0180.00316.39
7.4.130.0130.00816.32
7.4.120.0200.00016.40
7.4.110.0150.00416.33
7.4.100.0200.00016.52
7.4.90.0180.00316.40
7.4.80.0130.00816.29
7.4.70.0200.00016.28
7.4.60.0000.01316.37
7.4.50.0040.01116.28
7.4.40.0070.00716.26
7.4.30.0030.00916.27
7.4.20.0090.00316.20
7.4.10.0080.00416.21
7.4.00.0070.00716.38

preferences:
27.57 ms | 403 KiB | 5 Q