3v4l.org

run code in 300+ PHP versions simultaneously
<?php $slug = '/job/hello-this-is-my-job-posting-for-a-daycare-im-looking-for-in-91770-rosemead-california-12345'; $slugLimit = 70; echo preg_replace_callback( '~^(?:[^-]*-)*(?=(in-\d{5}-[^-]*-[^-]*-\d*)$)~u', fn($m) => preg_replace( '~^.{0,' . ($slugLimit - mb_strlen($m[1]) - 1) . '}-\K.*~u', '', $m[0] ), $slug );

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.00922.92
8.4.150.0020.00014.05
8.4.140.0080.01317.89
8.4.130.0110.00918.77
8.4.120.0130.00720.82
8.4.110.0060.00218.88
8.4.100.0150.00918.10
8.4.90.0110.00718.68
8.4.80.0120.00917.96
8.4.70.0060.00417.79
8.4.60.0100.01018.99
8.4.50.0160.00520.14
8.4.40.0060.01320.52
8.4.30.0100.01022.10
8.4.20.0060.00618.29
8.4.10.0060.00322.24
8.3.280.0140.00618.73
8.3.270.0150.00616.70
8.3.260.0110.00816.88
8.3.250.0130.00518.85
8.3.240.0100.01016.82
8.3.230.0100.00917.06
8.3.220.0100.00817.09
8.3.210.0120.00717.08
8.3.200.0050.00317.06
8.3.190.0080.00517.17
8.3.180.0110.00416.79
8.3.170.0110.00819.14
8.3.160.0030.00620.14
8.3.150.0120.00617.16
8.3.140.0130.00617.16
8.3.130.0190.00418.68
8.3.120.0150.00318.88
8.3.110.0040.00416.88
8.3.100.0040.00418.63
8.3.90.0050.00326.77
8.3.80.0060.00319.36
8.3.70.0030.01318.68
8.3.60.0060.01017.00
8.3.50.0090.00916.93
8.3.40.0090.00920.28
8.3.30.0150.00018.81
8.3.20.0040.00424.18
8.3.10.0000.00924.66
8.3.00.0040.00426.16
8.2.290.0150.00320.37
8.2.280.0100.00818.47
8.2.270.0030.00619.12
8.2.260.0090.00018.37
8.2.250.0080.00016.95
8.2.240.0080.00316.70
8.2.230.0040.00420.94
8.2.220.0100.00624.06
8.2.210.0120.00626.77
8.2.200.0060.00318.88
8.2.190.0110.00416.73
8.2.180.0100.01316.63
8.2.170.0090.00619.00
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00019.73
8.2.110.0070.00420.48
8.2.100.0100.00318.16
8.2.90.0050.00318.09
8.2.80.0040.00417.97
8.2.70.0000.00817.88
8.2.60.0120.00417.65
8.2.50.0160.00417.50
8.2.40.0100.00717.75
8.2.30.0000.01818.00
8.2.20.0000.00919.73
8.2.10.0110.00618.00
8.2.00.0140.00517.75
8.1.330.0120.00723.83
8.1.320.0140.00816.50
8.1.310.0110.00718.46
8.1.300.0050.00518.10
8.1.290.0040.00830.84
8.1.280.0070.00725.92
8.1.270.0060.00320.73
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.58
8.1.230.0080.00422.70
8.1.220.0080.00017.79
8.1.210.0080.00418.82
8.1.200.0030.00617.72
8.1.190.0120.00417.23
8.1.180.0100.00617.13
8.1.170.0140.00217.38
8.1.160.0120.00417.25
8.1.150.0060.01117.25
8.1.140.0000.01717.46
8.1.130.0120.00517.38
8.1.120.0090.00917.50
8.1.110.0170.00017.60
8.1.100.0000.01917.25
8.1.90.0110.00517.38
8.1.80.0110.00417.10
8.1.70.0130.00317.23
8.1.60.0110.00717.50
8.1.50.0090.00917.61
8.1.40.0180.00017.50
8.1.30.0150.00517.75
8.1.20.0130.00517.63
8.1.10.0110.00717.38
8.1.00.0180.00017.50
8.0.300.0000.00720.07
8.0.290.0000.00917.25
8.0.280.0150.00416.88
8.0.270.0100.00716.72
8.0.260.0120.00616.85
8.0.250.0160.00016.86
8.0.240.0130.00316.88
8.0.230.0110.00816.85
8.0.220.0000.01817.13
8.0.210.0140.00517.13
8.0.200.0070.01016.88
8.0.190.0040.01316.73
8.0.180.0160.00316.88
8.0.170.0170.00016.88
8.0.160.0130.00416.88
8.0.150.0130.00416.59
8.0.140.0110.00716.61
8.0.130.0190.00016.63
8.0.120.0140.00316.84
8.0.110.0090.00916.88
8.0.100.0110.00616.88
8.0.90.0120.00416.75
8.0.80.0060.01016.75
8.0.70.0140.00316.88
8.0.60.0110.00616.75
8.0.50.0070.01016.75
8.0.30.0120.00416.88
8.0.20.0080.00816.87
8.0.10.0150.00316.84

preferences:
30.93 ms | 403 KiB | 5 Q