3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ["split", "cat", "split", "dog", "cow"]; $rebuild = []; $offset = 0; foreach ($arr as $key => $value) { if ($value === 'split') { $rebuild = array_filter([...$rebuild, array_slice($arr, $offset, $key - $offset)]); $offset = ++$key; } } var_dump([...$rebuild, array_slice($arr, $offset, count($arr) - $offset)]);

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.5.70.0110.00816.75
8.5.60.0120.00716.91
8.5.50.0110.00716.58
8.5.30.0150.00619.22
8.5.20.0100.00721.40
8.5.10.0090.00820.25
8.5.00.0120.00919.83
8.4.210.0100.01119.40
8.4.180.0170.00719.58
8.4.170.0130.00923.84
8.4.160.0150.00924.91
8.4.150.0090.00416.84
8.4.140.0140.00817.79
8.4.130.0110.00917.95
8.4.120.0140.00620.42
8.4.110.0130.00722.14
8.4.100.0070.01017.83
8.4.90.0020.00720.46
8.4.80.0090.01119.37
8.4.70.0130.00919.71
8.4.60.0140.00718.51
8.4.50.0090.01317.81
8.4.40.0160.00320.40
8.4.30.0060.01320.78
8.4.20.0130.00617.90
8.4.10.0030.00624.00
8.3.300.0110.00820.67
8.3.290.0110.01020.90
8.3.280.0120.01218.38
8.3.270.0110.00816.21
8.3.260.0080.01116.40
8.3.250.0070.00218.75
8.3.240.0090.01217.27
8.3.230.0110.00816.50
8.3.220.0100.00817.11
8.3.210.0080.00716.48
8.3.200.0080.00116.59
8.3.190.0060.00217.08
8.3.180.0120.00716.48
8.3.170.0060.00316.79
8.3.160.0120.00616.76
8.3.150.0130.00317.29
8.3.140.0110.00716.47
8.3.130.0100.00016.63
8.3.120.0070.01120.41
8.3.110.0090.00020.94
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0050.00516.75
8.3.70.0090.00916.63
8.3.60.0160.00016.63
8.3.50.0110.00418.55
8.3.40.0080.00820.34
8.3.30.0070.00718.67
8.3.20.0070.00024.18
8.3.10.0050.00324.66
8.3.00.0060.00326.16
8.2.300.0100.00920.16
8.2.290.0130.00420.79
8.2.280.0100.00920.05
8.2.270.0040.01516.88
8.2.260.0100.00718.88
8.2.250.0000.00816.82
8.2.240.0060.00317.09
8.2.230.0080.00322.58
8.2.220.0100.00037.54
8.2.210.0070.01126.77
8.2.200.0030.00718.41
8.2.190.0140.00016.75
8.2.180.0100.00725.92
8.2.170.0140.00718.95
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0000.00819.77
8.2.110.0080.00020.34
8.2.100.0080.00417.78
8.2.90.0040.00417.75
8.2.80.0000.00818.90
8.2.70.0030.00617.38
8.2.60.0040.00417.38
8.2.50.0080.00017.80
8.2.40.0000.00817.93
8.2.30.0050.00218.05
8.2.20.0100.00019.13
8.2.10.0050.00218.16
8.2.00.0040.00419.30
8.1.340.0120.00817.55
8.1.330.0080.00622.15
8.1.320.0120.00816.04
8.1.310.0100.00716.53
8.1.300.0140.00718.06
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0060.01223.94
8.1.230.0000.01120.87
8.1.220.0030.00618.64
8.1.210.0080.00018.77
8.1.200.0000.00817.25
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0040.00417.62
8.1.160.0030.00518.90
8.1.150.0070.00018.65
8.1.140.0000.01117.46
8.1.130.0000.00718.74
8.1.120.0050.00317.49
8.1.110.0000.00717.46
8.1.100.0040.00417.45
8.1.90.0100.00317.30
8.1.80.0070.00717.38
8.1.70.0040.01117.45
8.1.60.0100.00617.51
8.1.50.0100.00517.34
8.1.40.0000.01517.39
8.1.30.0140.00317.63
8.1.20.0080.00817.63
8.1.10.0080.00817.34
8.1.00.0150.00317.44
8.0.300.0060.00318.77
8.0.290.0100.00016.75
8.0.280.0000.00718.46
8.0.270.0030.00316.87
8.0.260.0000.00618.41
8.0.250.0030.00316.99
8.0.240.0000.00716.83
8.0.230.0030.00316.86
8.0.220.0030.01016.84
8.0.210.0070.00716.71
8.0.200.0050.01016.94
8.0.190.0050.01016.81
8.0.180.0070.00716.82
8.0.170.0130.00316.88
8.0.160.0090.00616.77
8.0.150.0100.00716.77
8.0.140.0140.00016.83
8.0.130.0120.00216.68
8.0.120.0100.00316.89
8.0.110.0110.00316.91
8.0.100.0120.00316.75
8.0.90.0060.00916.85
8.0.80.0120.00316.86
8.0.70.0150.00016.86
8.0.60.0150.00016.79
8.0.50.0110.00416.73
8.0.30.0070.00416.73
8.0.20.0020.00716.84
8.0.10.0100.00317.01
7.4.330.0050.00015.55
7.4.320.0070.00016.52
7.4.300.0150.00016.52
7.4.290.0100.00416.48
7.4.280.0140.00216.58
7.4.270.0050.01116.53
7.4.260.0080.00816.60
7.4.250.0060.01116.59
7.4.240.0140.00316.50
7.4.230.0090.00916.54
7.4.220.0100.00516.51
7.4.210.0070.00816.52
7.4.200.0120.00316.48
7.4.190.0030.00616.56
7.4.180.0070.00316.27
7.4.160.0100.00016.64
7.4.150.0070.00316.03
7.4.140.0070.00416.38
7.4.130.0110.00016.19
7.4.120.0080.00216.07
7.4.110.0110.00016.13
7.4.100.0070.00416.25
7.4.90.0050.00515.98
7.4.80.0060.00316.27
7.4.70.0000.00816.45
7.4.60.0040.00716.46
7.4.50.0000.01216.32
7.4.40.0140.00016.27
7.4.30.0070.00716.42
7.4.20.0060.00416.32
7.4.10.0000.00916.33
7.4.00.0080.00016.41

preferences:
52.64 ms | 1277 KiB | 5 Q