3v4l.org

run code in 500+ PHP versions simultaneously
<?php var_dump(remove_last('bla test bla test bla test bla test bla', 'test', ' ')); function remove_last(string $text, string $subject, string $separator): string { if (($offset = strrpos($text, "$separator$subject")) === false) { $offset = strrpos($text, "$subject$separate"); } if ($offset !== false) { return substr_replace($text, '', $offset, strlen("$separator$subject")); } return $text; }

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.70.0100.00716.68
8.5.60.0160.00616.87
8.5.50.0100.00816.88
8.5.30.0110.01218.83
8.5.20.0120.00719.52
8.5.10.0110.00916.77
8.5.00.0130.01119.91
8.4.210.0090.01119.55
8.4.180.0110.01219.66
8.4.170.0170.00520.54
8.4.160.0120.00823.98
8.4.150.0060.00616.93
8.4.140.0110.01017.71
8.4.130.0080.00919.44
8.4.120.0100.01022.36
8.4.110.0030.00619.02
8.4.100.0050.00417.59
8.4.90.0120.00820.45
8.4.80.0100.00818.83
8.4.70.0050.00418.87
8.4.60.0080.00722.34
8.4.50.0110.00617.78
8.4.40.0040.00417.55
8.4.30.0130.00620.25
8.4.20.0130.00719.57
8.4.10.0070.01019.72
8.3.300.0080.01220.85
8.3.290.0110.01220.84
8.3.280.0110.00918.27
8.3.270.0110.01416.57
8.3.260.0100.00916.59
8.3.250.0110.00818.58
8.3.240.0120.00716.77
8.3.230.0120.00716.47
8.3.220.0050.00319.05
8.3.210.0110.00716.75
8.3.200.0050.00416.51
8.3.190.0110.00816.76
8.3.180.0110.01016.54
8.3.170.0040.01417.21
8.3.160.0090.00918.59
8.3.150.0060.01316.80
8.3.140.0070.01116.43
8.3.130.0050.00516.48
8.3.120.0000.00818.89
8.3.110.0060.00320.94
8.3.100.0070.00424.06
8.3.90.0080.00026.77
8.3.80.0090.00016.63
8.3.70.0090.00616.58
8.3.60.0180.00418.31
8.3.50.0120.00319.84
8.3.40.0040.01119.21
8.3.30.0000.01518.63
8.3.20.0050.00224.18
8.3.10.0050.00324.66
8.3.00.0070.00426.16
8.2.300.0120.00822.02
8.2.290.0120.00717.30
8.2.280.0110.00818.39
8.2.270.0050.00217.14
8.2.260.0060.00317.14
8.2.250.0160.00318.48
8.2.240.0030.00617.28
8.2.230.0060.00322.58
8.2.220.0030.01337.54
8.2.210.0040.00426.77
8.2.200.0080.00016.49
8.2.190.0070.01416.75
8.2.180.0100.00625.92
8.2.170.0060.00918.99
8.2.160.0160.00322.96
8.2.150.0070.00325.66
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0060.00322.08
8.2.100.0040.00817.70
8.2.90.0000.00819.07
8.2.80.0000.00817.97
8.2.70.0000.00917.63
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0030.00618.22
8.2.30.0100.00019.72
8.2.20.0000.00819.48
8.2.10.0070.00017.79
8.2.00.0040.00419.19
8.1.340.0130.01117.80
8.1.330.0120.00816.07
8.1.320.0120.00819.87
8.1.310.0080.00018.28
8.1.300.0000.00918.55
8.1.290.0030.00630.84
8.1.280.0160.00325.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00719.09
8.1.230.0040.00720.92
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0000.00817.22
8.1.180.0030.00518.10
8.1.170.0080.00318.28
8.1.160.0090.00018.87
8.1.150.0000.00818.58
8.1.140.0000.00917.38
8.1.130.0040.00417.29
8.1.120.0000.00817.32
8.1.110.0040.00417.37
8.1.100.0070.00017.45
8.1.90.0000.00717.42
8.1.80.0000.00917.35
8.1.70.0030.00317.32
8.1.60.0000.00817.47
8.1.50.0110.00017.57
8.1.40.0040.00417.55
8.1.30.0060.00317.52
8.1.20.0040.00417.61
8.1.10.0030.00617.55
8.1.00.0070.00017.40
8.0.300.0040.00418.77
8.0.290.0070.00316.75
8.0.280.0040.00418.44
8.0.270.0000.00716.86
8.0.260.0000.00716.85
8.0.250.0000.00716.86
8.0.240.0000.00616.99
8.0.230.0030.00316.88
8.0.220.0000.00716.82
8.0.210.0070.00016.78
8.0.200.0030.00316.92
8.0.190.0040.00416.82
8.0.180.0000.00716.95
8.0.170.0040.00416.87
8.0.160.0040.00416.86
8.0.150.0040.00416.81
8.0.140.0070.00016.73
8.0.130.0000.00613.36
8.0.120.0070.00016.93
8.0.110.0040.00416.89
8.0.100.0030.00316.88
8.0.90.0000.00716.82
8.0.80.0030.00316.85
8.0.70.0000.00716.77
8.0.60.0070.00016.81
8.0.50.0000.00716.93
8.0.30.0030.00316.78
8.0.20.0000.00716.86
8.0.10.0070.00016.92
8.0.00.0000.00716.96
7.4.330.0020.00215.55
7.4.320.0000.00616.59
7.4.300.0060.00016.44
7.4.290.0000.00716.48
7.4.280.0000.00816.40
7.4.270.0040.00416.62
7.4.260.0000.00513.30
7.4.250.0030.00316.52
7.4.240.0000.00816.42
7.4.230.0040.00416.57
7.4.220.0070.00016.61
7.4.210.0030.00316.48
7.4.200.0000.00616.51
7.4.190.0030.00316.62
7.4.180.0000.00716.66
7.4.160.0030.00316.66
7.4.150.0030.00316.52
7.4.140.0070.00016.50
7.4.130.0030.00316.52
7.4.120.0040.00416.35
7.4.110.0030.00316.44
7.4.100.0030.00316.62
7.4.90.0040.00416.48
7.4.80.0050.00316.46
7.4.70.0000.00716.36
7.4.60.0000.00716.52
7.4.50.0000.00816.30
7.4.40.0000.00716.39
7.4.30.0000.00816.50
7.4.20.0000.00816.51
7.4.10.0020.00516.31
7.4.00.0030.00316.41
7.3.330.0040.00416.25
7.3.320.0040.00413.26
7.3.310.0070.00016.31
7.3.300.0030.00316.20
7.3.290.0000.00716.39
7.3.280.0040.00416.20
7.3.270.0050.00216.25
7.3.260.0000.00816.34
7.3.250.0030.00316.35
7.3.240.0030.00316.37
7.3.230.0030.00316.41
7.3.220.0000.00716.32
7.3.210.0000.00716.25
7.3.200.0050.00216.18
7.3.190.0040.00416.25
7.3.180.0000.00716.16
7.3.170.0030.00316.35
7.3.160.0000.00616.34
7.3.150.0060.00016.35
7.3.140.0000.00616.16
7.3.130.0000.00616.26
7.3.120.0030.00316.29
7.3.110.0030.00316.05
7.3.100.0030.00316.10
7.3.90.0000.00716.61
7.3.80.0040.00416.19
7.3.70.0070.00016.30
7.3.60.0040.00416.52
7.3.50.0000.00616.36
7.3.40.0070.00016.42
7.3.30.0060.00016.45
7.3.20.0000.00716.53
7.3.10.0000.00716.26
7.3.00.0070.00016.30

preferences:
96.68 ms | 1397 KiB | 5 Q