3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str= 'There must be a fast and efficient way to split a (text) string at the "nth" occurrence of a needle.'; var_export( preg_split('/([^ ]*\K ){2}/', $str) );

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.140.0130.00917.45
8.4.130.0040.00619.75
8.4.120.0070.00124.20
8.4.110.0080.01118.83
8.4.100.0100.01018.72
8.4.90.0140.00718.45
8.4.80.0060.00218.49
8.4.70.0140.00618.04
8.4.60.0040.00518.56
8.4.50.0150.00617.63
8.4.40.0030.01620.59
8.4.30.0090.01018.96
8.4.20.0110.00722.18
8.4.10.0080.01223.53
8.3.270.0110.01016.55
8.3.260.0100.01016.61
8.3.250.0110.00518.57
8.3.240.0100.00917.10
8.3.230.0130.00616.79
8.3.220.0120.00818.86
8.3.210.0140.00516.77
8.3.200.0070.00216.59
8.3.190.0100.00816.93
8.3.180.0130.00616.47
8.3.170.0040.01520.65
8.3.160.0100.00717.04
8.3.150.0080.01217.11
8.3.140.0120.00618.41
8.3.130.0000.00817.20
8.3.120.0030.00620.63
8.3.110.0060.00320.94
8.3.100.0090.00624.06
8.3.90.0070.00726.77
8.3.80.0030.00617.97
8.3.70.0110.01118.56
8.3.60.0110.00718.43
8.3.50.0190.00016.68
8.3.40.0120.00321.85
8.3.30.0070.00718.71
8.3.20.0000.00724.18
8.3.10.0050.00324.66
8.3.00.0050.00326.16
8.2.290.0100.00918.98
8.2.280.0130.00620.48
8.2.270.0120.00616.93
8.2.260.0090.00916.96
8.2.250.0170.00716.67
8.2.240.0060.00917.47
8.2.230.0080.00322.58
8.2.220.0030.00637.54
8.2.210.0090.00626.77
8.2.200.0150.00016.63
8.2.190.0120.00616.75
8.2.180.0110.00316.63
8.2.170.0100.01018.96
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.01121.16
8.2.110.0060.00321.16
8.2.100.0120.00017.78
8.2.90.0000.00818.09
8.2.80.0060.00318.22
8.2.70.0080.00017.63
8.2.60.0000.00817.75
8.2.50.0130.00419.52
8.2.40.0130.00419.52
8.2.30.0080.00819.52
8.2.20.0140.00219.52
8.2.10.0080.00819.52
8.2.00.0190.00019.52
8.1.330.0120.00716.32
8.1.320.0110.00916.29
8.1.310.0030.01418.21
8.1.300.0030.00719.76
8.1.290.0090.00030.84
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00622.55
8.1.230.0060.00622.82
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0060.00317.25
8.1.190.0080.00017.13
8.1.180.0100.00719.52
8.1.170.0110.00519.52
8.1.160.0130.00319.52
8.1.150.0080.00819.52
8.1.140.0080.00819.52
8.1.130.0100.00719.52
8.1.120.0090.00919.52
8.1.110.0120.00419.52
8.1.100.0160.00319.52
8.1.90.0090.00919.52
8.1.80.0120.00419.52
8.1.70.0130.00419.52
8.1.60.0130.00719.52
8.1.50.0090.00919.52
8.1.40.0100.00719.52
8.1.30.0140.00419.52
8.1.20.0090.00919.52
8.1.10.0080.00819.52
8.1.00.0180.00019.52
8.0.300.0080.00019.71
8.0.290.0000.00816.88
8.0.280.0100.00819.52
8.0.270.0120.00419.52
8.0.260.0130.00419.52
8.0.250.0080.00819.52
8.0.240.0110.00619.52
8.0.230.0140.00419.52
8.0.220.0160.00019.52
8.0.210.0170.00019.52
8.0.200.0130.00319.52
8.0.190.0100.00719.52
8.0.180.0190.00019.52
8.0.170.0120.00519.52
8.0.160.0170.00019.52
8.0.150.0060.01219.52
8.0.140.0120.00619.52
8.0.130.0140.00019.52
8.0.120.0160.00019.52
8.0.110.0120.00319.52
8.0.100.0070.01119.52
8.0.90.0120.00619.52
8.0.80.0100.00719.52
8.0.70.0120.00619.52
8.0.60.0170.00019.52
8.0.50.0100.00719.52
8.0.30.0160.00019.52
8.0.20.0110.00619.52
8.0.10.0110.00519.52

preferences:
71.7 ms | 403 KiB | 5 Q