3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'aaa, bbb, ccc, ddd, eee, fff'; $n = 3; var_export( preg_replace("/(?:[^,]*\K,){{$n}}.*/s", '', $string) );

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.0110.01018.14
8.4.110.0120.00918.13
8.4.100.0130.00818.05
8.4.90.0130.00720.52
8.4.80.0070.00318.84
8.4.70.0140.00918.75
8.4.60.0090.01118.90
8.4.50.0130.00718.78
8.4.40.0060.00317.71
8.4.30.0110.00820.58
8.4.20.0040.00419.26
8.4.10.0100.01019.68
8.3.250.0050.00418.92
8.3.240.0060.00816.63
8.3.230.0090.01016.54
8.3.220.0040.00618.81
8.3.210.0100.00518.56
8.3.200.0050.00416.57
8.3.190.0100.00917.08
8.3.180.0130.00616.83
8.3.170.0090.00916.95
8.3.160.0060.01320.65
8.3.150.0060.00317.02
8.3.140.0190.00016.86
8.3.130.0070.00318.71
8.3.120.0200.00416.59
8.3.110.0190.00416.59
8.3.100.0250.00316.51
8.3.90.0240.00316.49
8.3.80.0200.00416.82
8.3.70.0190.00816.42
8.3.60.0220.00316.61
8.3.50.0170.00816.30
8.3.40.0190.00017.70
8.3.30.0160.00317.75
8.3.20.0130.00717.27
8.3.10.0110.00917.64
8.3.00.0130.00019.27
8.2.290.0130.00616.95
8.2.280.0110.00818.46
8.2.270.0130.00716.74
8.2.260.0050.00317.40
8.2.250.0110.00716.63
8.2.240.0120.00916.45
8.2.230.0200.00016.20
8.2.220.0180.00416.17
8.2.210.0180.00416.07
8.2.200.0080.01118.38
8.2.190.0120.00816.43
8.2.180.0200.00016.70
8.2.170.0160.00517.57
8.2.160.0140.00717.39
8.2.150.0160.00617.48
8.2.140.0190.00419.35
8.2.130.0140.00717.48
8.2.120.0210.00017.63
8.2.110.0150.00717.33
8.2.100.0190.00317.39
8.2.90.0170.00617.50
8.2.80.0190.00817.50
8.2.70.0230.00019.27
8.2.60.0120.00817.65
8.2.50.0190.00417.60
8.2.40.0100.01017.63
8.2.30.0160.00517.43
8.2.20.0140.00517.48
8.2.10.0180.00017.70
8.2.00.0180.00017.39
8.1.330.0090.00916.38
8.1.320.0130.00717.88
8.1.310.0140.00416.44
8.1.300.0190.00216.40
8.1.290.0170.00316.05
8.1.280.0140.00916.30
8.1.270.0150.00617.53
8.1.260.0180.00517.04
8.1.250.0130.00917.55
8.1.240.0120.00617.27
8.1.230.0180.00217.24
8.1.220.0110.00717.29
8.1.210.0150.00418.96
8.1.200.0160.00317.09
8.1.190.0140.00417.14
8.1.180.0130.00417.14
8.1.170.0140.00417.34
8.1.160.0070.01117.23
8.1.150.0180.00019.02
8.1.140.0090.00917.14
8.1.130.0160.00317.18
8.1.120.0150.00417.02
8.1.110.0170.00219.12
8.1.100.0110.00617.16
8.1.90.0120.00817.23
8.1.80.0190.00017.28
8.1.70.0160.00317.03
8.1.60.0140.00617.16
8.1.50.0190.00017.41
8.1.40.0160.00519.25
8.1.30.0120.00817.64
8.1.20.0160.00517.35
8.1.10.0160.00417.27
8.1.00.0190.00417.13

preferences:
48.6 ms | 403 KiB | 5 Q