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, 2) );

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.00817.59
8.4.130.0150.01017.73
8.4.120.0060.00424.11
8.4.110.0130.00819.00
8.4.100.0150.00617.69
8.4.90.0090.01118.53
8.4.80.0070.00218.02
8.4.70.0110.00917.57
8.4.60.0120.00918.50
8.4.50.0130.00817.98
8.4.40.0100.01020.38
8.4.30.0070.00723.83
8.4.20.0030.01619.65
8.4.10.0030.00623.81
8.3.270.0100.01216.38
8.3.260.0070.00616.41
8.3.250.0110.00718.82
8.3.240.0120.00616.94
8.3.230.0130.00616.60
8.3.220.0070.00217.00
8.3.210.0090.01016.65
8.3.200.0060.00216.80
8.3.190.0080.00717.22
8.3.180.0100.00918.44
8.3.170.0110.00318.68
8.3.160.0070.01017.06
8.3.150.0130.00717.02
8.3.140.0060.01216.53
8.3.130.0050.00316.63
8.3.120.0060.00318.96
8.3.110.0030.00720.94
8.3.100.0060.00324.06
8.3.90.0090.00026.77
8.3.80.0030.00618.55
8.3.70.0150.00418.31
8.3.60.0120.00616.50
8.3.50.0130.00916.58
8.3.40.0100.00323.78
8.3.30.0070.00718.68
8.3.20.0000.00824.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0030.00520.32
8.2.280.0060.00318.83
8.2.270.0090.00918.92
8.2.260.0120.00318.57
8.2.250.0100.00716.49
8.2.240.0030.00719.00
8.2.230.0080.01122.58
8.2.220.0030.00637.54
8.2.210.0070.00726.77
8.2.200.0060.00316.75
8.2.190.0180.00318.79
8.2.180.0100.00618.53
8.2.170.0140.00018.78
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0120.00619.74
8.2.110.0090.00021.06
8.2.100.0040.00817.91
8.2.90.0060.00317.91
8.2.80.0040.00417.97
8.2.70.0040.00417.68
8.2.60.0150.00417.25
8.2.50.0160.00317.38
8.2.40.0120.00417.25
8.2.30.0090.00917.25
8.2.20.0140.00517.63
8.2.10.0170.00017.38
8.2.00.0060.01017.25
8.1.330.0160.00318.28
8.1.320.0120.00716.62
8.1.310.0090.00918.27
8.1.300.0030.00620.02
8.1.290.0030.00730.84
8.1.280.0150.00025.92
8.1.270.0070.00024.66
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0120.00020.30
8.1.230.0060.00620.89
8.1.220.0040.00417.74
8.1.210.0080.00018.94
8.1.200.0060.00317.35
8.1.190.0070.00017.35
8.1.180.0140.00517.25
8.1.170.0090.00817.13
8.1.160.0100.00616.98
8.1.150.0050.01417.38
8.1.140.0150.00517.00
8.1.130.0120.00417.13
8.1.120.0170.00017.23
8.1.110.0130.00417.00
8.1.100.0130.00317.09
8.1.90.0130.00317.50
8.1.80.0000.01716.87
8.1.70.0060.01117.38
8.1.60.0160.00417.63
8.1.50.0160.00317.23
8.1.40.0100.01017.35
8.1.30.0090.00917.25
8.1.20.0090.00917.25
8.1.10.0140.00617.25
8.1.00.0130.00617.23
8.0.300.0070.00019.76
8.0.290.0060.00316.75
8.0.280.0120.00616.52
8.0.270.0160.00316.61
8.0.260.0130.00416.63
8.0.250.0150.00316.52
8.0.240.0090.00616.75
8.0.230.0110.00616.75
8.0.220.0160.00016.75
8.0.210.0140.00416.52
8.0.200.0030.01316.52
8.0.190.0000.01616.52
8.0.180.0040.01316.52
8.0.170.0130.00316.75
8.0.160.0070.01016.52
8.0.150.0160.00016.59
8.0.140.0170.00016.52
8.0.130.0100.00516.74
8.0.120.0070.01016.52
8.0.110.0090.00716.75
8.0.100.0090.00916.52
8.0.90.0120.00516.74
8.0.80.0160.00016.52
8.0.70.0170.00016.63
8.0.60.0080.00816.52
8.0.50.0170.00016.52
8.0.30.0110.00616.75
8.0.20.0200.00216.52
8.0.10.0100.00816.63

preferences:
31.13 ms | 403 KiB | 5 Q