3v4l.org

run code in 300+ PHP versions simultaneously
<?php function remove_after($needle, $haystack, $removeNeedle = false) { $needle = preg_quote($needle) . ($removeNeedle ? '' : '\K'); return preg_replace("#.*\K$needle.*#s", '', $haystack); } var_dump(remove_after("cheese", "The cheese is good and the cheese is yummy")); var_dump(remove_after("cheese", "The cheese is good and the cheese is yummy", true));

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.00.0120.00920.09
8.4.150.0020.00014.05
8.4.140.0120.00817.77
8.4.130.0080.00518.14
8.4.120.0090.01020.79
8.4.110.0150.00522.71
8.4.100.0110.01017.98
8.4.90.0110.01017.89
8.4.80.0070.00218.09
8.4.70.0480.00617.61
8.4.60.0420.01017.80
8.4.50.0330.00917.66
8.4.40.0200.00717.80
8.4.30.0180.00619.14
8.4.20.0200.00417.47
8.4.10.0210.00417.31
8.3.280.0100.01018.62
8.3.270.0140.00616.86
8.3.260.0110.00816.80
8.3.250.0100.00818.88
8.3.240.0100.01016.87
8.3.230.0140.00616.65
8.3.220.0120.00718.70
8.3.210.0210.00316.54
8.3.200.0240.01016.70
8.3.190.0190.00418.26
8.3.180.0170.00616.58
8.3.170.0200.00316.41
8.3.160.0170.00616.54
8.3.150.0200.00416.34
8.3.140.0190.00716.80
8.3.130.0190.00316.57
8.3.120.0190.00416.34
8.3.110.0190.00216.40
8.3.100.0170.00516.36
8.3.90.0150.00616.56
8.3.80.0160.00616.73
8.3.70.0200.00216.55
8.3.60.0180.00516.71
8.3.50.0200.00316.41
8.3.40.0160.00317.54
8.3.30.0130.00817.22
8.3.20.0140.00517.47
8.3.10.0150.00317.55
8.3.00.0080.00517.44
8.2.290.0090.01018.75
8.2.280.0140.00416.73
8.2.270.0210.00616.25
8.2.260.0230.00518.34
8.2.250.0270.00316.63
8.2.240.0200.00616.49
8.2.230.0150.00416.91
8.2.220.0160.00316.79
8.2.210.0140.00316.56
8.2.200.0170.00816.47
8.2.190.0150.00318.29
8.2.180.0140.00616.31
8.2.170.0150.00417.69
8.2.160.0200.00817.44
8.2.150.0230.01117.38
8.2.140.0340.00517.60
8.2.130.0160.00817.57
8.2.120.0300.00817.61
8.2.110.0270.00919.38
8.2.100.0230.00817.70
8.2.90.0190.00717.71
8.2.80.0200.00717.79
8.2.70.0190.00517.70
8.2.60.0170.00417.51
8.2.50.0180.00417.67
8.2.40.0160.00417.48
8.2.30.0190.00517.64
8.2.20.0140.00517.45
8.2.10.0200.00618.91
8.2.00.0250.00517.43

preferences:
37.35 ms | 403 KiB | 5 Q