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.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.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.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:
42.02 ms | 401 KiB | 5 Q