3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 17 => 'absv shss xcnx shss hshhs shhsw shshs hsnna hssnnss hssns snnss nnshs sjjjjsjsj nsnnnsns jjsnss snsnns nsnns', 8 => 'absv shss xcnx shss hshhs shhsw shshs hsnna', 5 => 'absv shss xcnx shss hshhs' ]; $wordLimit = 8; foreach ($strings as $string) { echo preg_replace('/(?:\s*\S++){' . $wordLimit . '}\K.+/', '...', $string); echo "\n---\n"; }

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.10.0110.01116.68
8.5.00.0130.01020.14
8.4.150.0020.00014.05
8.4.140.0120.01017.81
8.4.130.0060.00418.84
8.4.120.0110.00824.10
8.4.110.0110.00918.70
8.4.100.0110.00918.94
8.4.90.0100.01120.42
8.4.80.0090.01117.80
8.4.70.0100.00317.90
8.4.60.0140.00918.69
8.4.50.0130.00618.62
8.4.40.0030.00518.11
8.4.30.0040.01820.51
8.4.20.0170.00319.80
8.4.10.0120.00917.74
8.3.280.0130.00718.62
8.3.270.0130.01216.64
8.3.260.0110.00816.71
8.3.250.0070.01219.09
8.3.240.0110.00517.37
8.3.230.0080.00116.82
8.3.220.0110.00717.22
8.3.210.0130.00518.50
8.3.200.0060.00316.84
8.3.190.0120.00816.80
8.3.180.0050.00418.54
8.3.170.0090.00918.85
8.3.160.0030.01620.43
8.3.150.0120.00618.52
8.3.140.0040.00417.13
8.3.130.0060.00318.64
8.3.120.0060.00319.11
8.3.110.0000.00920.94
8.3.100.0070.01124.06
8.3.90.0000.00826.77
8.3.80.0090.00016.63
8.3.70.0090.00616.63
8.3.60.0150.00716.63
8.3.50.0170.00320.01
8.3.40.0060.00919.18
8.3.30.0120.00318.61
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0140.00516.51
8.2.280.0060.01318.53
8.2.270.0110.00717.26
8.2.260.0040.00416.89
8.2.250.0040.00417.20
8.2.240.0030.00518.41
8.2.230.0060.00322.58
8.2.220.0100.00037.54
8.2.210.0110.00726.77
8.2.200.0040.00716.50
8.2.190.0100.01016.75
8.2.180.0120.00425.92
8.2.170.0040.01119.09
8.2.160.0070.01022.96
8.2.150.0000.00825.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00421.25
8.2.110.0100.00022.20
8.2.100.0030.00917.91
8.2.90.0080.00017.75
8.2.80.0080.00019.00
8.2.70.0000.00817.93
8.2.60.0040.00417.75
8.2.50.0080.00017.63
8.2.40.0000.00819.73
8.2.30.0000.00917.84
8.2.20.0040.00419.60
8.2.10.0000.00717.71
8.2.00.0040.00719.28
8.1.330.0110.00721.99
8.1.320.0130.00716.26
8.1.310.0040.00418.33
8.1.300.0030.00617.90
8.1.290.0040.00418.88
8.1.280.0100.00625.92
8.1.270.0040.00423.99
8.1.260.0100.00726.35
8.1.250.0070.00328.09
8.1.240.0000.00920.87
8.1.230.0060.00617.64
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0040.00417.47
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0020.00518.82
8.1.160.0000.00818.92
8.1.150.0000.00718.76
8.1.140.0040.00417.61
8.1.130.0030.00318.93
8.1.120.0000.00717.56
8.1.110.0030.00617.57
8.1.100.0000.00817.62
8.1.90.0050.00317.50
8.1.80.0040.00417.49
8.1.70.0030.00317.52
8.1.60.0040.00417.72
8.1.50.0090.00017.71
8.1.40.0080.00017.70
8.1.30.0000.00817.74
8.1.20.0090.00017.72
8.1.10.0000.00817.66
8.1.00.0070.00017.48
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0040.00418.21
8.0.270.0030.00316.97
8.0.260.0030.00318.34
8.0.250.0000.00717.07
8.0.240.0070.00017.07
8.0.230.0030.00316.99
8.0.220.0030.00317.05
8.0.210.0000.00717.04
8.0.200.0050.00317.00
8.0.190.0000.00917.06
8.0.180.0000.00717.07
8.0.170.0050.00317.05
8.0.160.0080.00016.93
8.0.150.0000.00716.88
8.0.140.0000.00816.99
8.0.130.0040.00413.55
8.0.120.0050.00913.40
8.0.110.0100.00313.43
8.0.100.0140.00013.46
8.0.90.0130.00013.48
8.0.80.0080.00413.41
8.0.70.0140.00013.41
8.0.60.0070.00713.38
8.0.50.0110.00313.41
8.0.30.0090.00413.39
8.0.20.0040.00813.49
8.0.10.0040.00913.52
8.0.00.0030.00613.58
7.4.330.0040.00015.55
7.4.320.0000.00716.71
7.4.300.0000.00716.69
7.4.290.0030.00316.77
7.4.280.0070.00016.72
7.4.270.0050.00316.66
7.4.260.0030.00313.50
7.4.250.0120.00413.43
7.4.240.0080.00413.36
7.4.230.0110.00413.55
7.4.220.0070.00713.49
7.4.210.0100.00313.43
7.4.200.0080.00413.50
7.4.190.0150.00013.63
7.4.180.0110.00313.58
7.4.160.0140.00013.57
7.4.150.0090.00513.56
7.4.140.0040.00913.51
7.4.130.0050.00813.57
7.4.120.0130.00013.47
7.4.110.0130.00013.34
7.4.100.0070.00713.55
7.4.90.0130.00013.38
7.4.80.0090.00413.46
7.4.70.0090.00513.58
7.4.60.0050.00913.41
7.4.50.0000.01013.33
7.4.40.0070.00413.26
7.4.30.0060.00613.48
7.4.20.0080.00413.26
7.4.10.0060.00313.36
7.4.00.0080.00413.41
7.3.330.0030.00616.42
7.3.320.0090.00213.14
7.3.310.0070.00613.30
7.3.300.0120.00313.22
7.3.290.0150.00013.21
7.3.280.0060.00613.32
7.3.270.0050.00813.19
7.3.260.0080.00613.27
7.3.250.0060.00713.20
7.3.240.0070.00713.21
7.3.230.0090.00313.22
7.3.220.0100.00313.06
7.3.210.0130.00013.15
7.3.200.0120.00213.05
7.3.190.0150.00013.14
7.3.180.0110.00413.06
7.3.170.0100.00313.21
7.3.160.0100.00313.07
7.3.150.0080.00413.09
7.3.140.0130.00013.03
7.3.130.0060.00613.26
7.3.120.0090.00213.07
7.3.110.0100.00413.13
7.3.100.0080.00312.96
7.3.90.0080.00313.51
7.3.80.0000.01213.21
7.3.70.0100.00313.40
7.3.60.0130.00013.32
7.3.50.0080.00613.38
7.3.40.0070.00713.46
7.3.30.0070.00413.43
7.3.20.0060.00315.16
7.3.10.0070.00015.07
7.3.00.0000.00615.03

preferences:
162.6 ms | 403 KiB | 5 Q