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) => implode([ preg_replace( '~^.{0,' . ($slugLimit - mb_strlen($m[2]) - 1) . '}-\K.*~u', '', $m[1] ), $m[2] ]), $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.4.120.0100.00320.48
8.4.110.0050.00520.73
8.4.100.0120.00518.91
8.4.90.0100.01018.20
8.4.80.0130.00718.07
8.4.70.0100.01018.36
8.4.60.0100.01319.81
8.4.50.0080.00418.81
8.4.40.0030.01720.79
8.4.30.0070.00722.08
8.4.20.0100.00518.07
8.4.10.0030.00621.93
8.3.250.0100.01019.12
8.3.240.0040.00516.95
8.3.230.0110.00516.70
8.3.220.0080.00419.29
8.3.210.0130.00617.00
8.3.200.0040.00416.72
8.3.190.0100.00817.11
8.3.180.0090.01017.43
8.3.170.0120.00320.70
8.3.160.0120.00617.42
8.3.150.0030.01517.09
8.3.140.0080.00016.96
8.3.130.0070.01118.83
8.3.120.0060.00318.91
8.3.110.0160.00016.79
8.3.100.0100.00717.09
8.3.90.0150.00426.77
8.3.80.0040.00818.56
8.3.70.0120.00318.80
8.3.60.0070.00716.75
8.3.50.0180.00416.94
8.3.40.0110.00620.20
8.3.30.0110.00418.83
8.3.20.0000.00724.18
8.3.10.0000.00924.66
8.3.00.0080.00026.16
8.2.290.0110.00520.60
8.2.280.0110.00816.82
8.2.270.0150.00317.33
8.2.260.0090.00917.02
8.2.250.0050.00318.80
8.2.240.0000.00818.50
8.2.230.0040.00420.94
8.2.220.0100.00024.06
8.2.210.0000.00826.77
8.2.200.0090.00018.67
8.2.190.0140.00416.88
8.2.180.0140.00416.63
8.2.170.0070.01119.08
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00421.12
8.2.110.0080.00019.17
8.2.100.0060.00617.95
8.2.90.0040.00421.19
8.2.80.0000.00720.54
8.2.70.0040.00417.88
8.2.60.0110.00717.38
8.2.50.0120.00617.50
8.2.40.0140.00317.75
8.2.30.0170.00017.75
8.2.20.0110.00517.75
8.2.10.0120.00617.88
8.2.00.0180.00017.50
8.1.330.0110.00822.30
8.1.320.0130.00616.63
8.1.310.0030.00618.38
8.1.300.0100.00716.41
8.1.290.0090.00030.84
8.1.280.0170.00325.92
8.1.270.0110.00724.66
8.1.260.0000.00726.35
8.1.250.0090.00028.09
8.1.240.0070.00322.19
8.1.230.0060.00620.86
8.1.220.0050.00317.79
8.1.210.0040.00418.97
8.1.200.0000.00917.60
8.1.190.0110.00617.25
8.1.180.0170.00017.24
8.1.170.0150.00017.50
8.1.160.0120.00417.24
8.1.150.0120.00617.25
8.1.140.0120.00417.00
8.1.130.0100.00717.13
8.1.120.0090.00917.22
8.1.110.0130.00517.10
8.1.100.0130.00317.24
8.1.90.0060.01217.22
8.1.80.0120.00617.25
8.1.70.0120.00417.00
8.1.60.0120.00617.37
8.1.50.0070.01017.50
8.1.40.0120.00617.63
8.1.30.0050.01417.63
8.1.20.0040.01617.50
8.1.10.0180.00017.50
8.1.00.0150.00517.38
8.0.300.0000.00720.01
8.0.290.0000.00817.00
8.0.280.0090.00916.75
8.0.270.0130.00316.88
8.0.260.0130.00316.88
8.0.250.0130.00416.63
8.0.240.0110.00516.71
8.0.230.0140.00316.84
8.0.220.0110.00516.88
8.0.210.0170.00016.75
8.0.200.0140.00616.88
8.0.190.0160.00216.88
8.0.180.0150.00317.00
8.0.170.0100.00716.86
8.0.160.0110.00616.88
8.0.150.0170.00016.88
8.0.140.0180.00316.75
8.0.130.0160.00316.84
8.0.120.0110.00616.63
8.0.110.0050.01117.00
8.0.100.0160.00016.75
8.0.90.0120.00416.75
8.0.80.0110.00517.00
8.0.70.0130.00316.88
8.0.60.0080.00816.63
8.0.50.0080.00816.88
8.0.30.0110.00516.88
8.0.20.0130.00216.98
8.0.10.0160.00016.63

preferences:
29.17 ms | 403 KiB | 5 Q