3v4l.org

run code in 300+ PHP versions simultaneously
<?php $title = "Convert all dashes/underscores into separator"; $separator = "-"; $flip = $separator == '-' ? '_' : '-'; $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); // Remove all characters that are not the separator, letters, numbers, or whitespace. $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title)); // Replace all separator characters and whitespace by a single separator $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); echo trim($title, $separator);

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.3.60.0050.01418.68
8.3.50.0230.00921.35
8.3.40.0140.00419.09
8.3.30.0070.00718.89
8.3.20.0070.00020.35
8.3.10.0070.00023.61
8.3.00.0060.00319.64
8.2.180.0130.00718.66
8.2.170.0120.00322.96
8.2.160.0140.00320.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0060.00317.88
8.2.110.0080.00020.52
8.2.100.0000.01117.97
8.2.90.0000.00819.36
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0070.00417.68
8.2.50.0050.00318.07
8.2.40.0080.00021.11
8.2.30.0080.00020.72
8.2.20.0040.00417.84
8.2.10.0000.00718.13
8.2.00.0070.00018.26
8.1.280.0110.01125.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00322.08
8.1.230.0030.00922.65
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0080.00017.50
8.1.190.0000.00817.48
8.1.180.0070.00018.10
8.1.170.0030.00620.50
8.1.160.0000.00722.16
8.1.150.0000.00718.99
8.1.140.0040.00419.73
8.1.130.0000.00817.92
8.1.120.0040.00417.64
8.1.110.0050.00217.59
8.1.100.0030.00617.56
8.1.90.0000.00717.60
8.1.80.0070.00017.66
8.1.70.0030.00317.57
8.1.60.0040.00417.78
8.1.50.0040.00417.75
8.1.40.0000.01117.70
8.1.30.0030.00917.76
8.1.20.0030.00617.76
8.1.10.0050.00317.63
8.1.00.0050.00317.55
8.0.300.0020.00518.77
8.0.290.0000.00817.00
8.0.280.0000.00818.59
8.0.270.0030.00317.26
8.0.260.0030.00317.28
8.0.250.0000.00817.24
8.0.240.0000.00717.23
8.0.230.0060.00017.19
8.0.220.0070.00017.13
8.0.210.0050.00317.12
8.0.200.0000.00717.23
8.0.190.0000.00817.25
8.0.180.0070.00017.18
8.0.170.0000.00717.23
8.0.160.0000.00717.14
8.0.150.0070.00016.98
8.0.140.0000.00817.08
8.0.130.0000.00613.61
8.0.120.0090.00017.16
8.0.110.0040.00417.32
8.0.100.0040.00417.27
8.0.90.0040.00417.10
8.0.80.0120.00317.11
8.0.70.0040.00417.21
8.0.60.0050.00217.01
8.0.50.0050.00217.10
8.0.30.0060.01517.20
8.0.20.0070.01217.40
8.0.10.0040.00417.09
8.0.00.0080.01217.05
7.4.330.0000.00515.12
7.4.320.0000.00716.95
7.4.300.0030.00316.92
7.4.290.0030.00316.95
7.4.280.0050.00316.73
7.4.270.0030.00316.89
7.4.260.0020.00516.82
7.4.250.0000.00716.84
7.4.240.0050.00216.85
7.4.230.0000.00716.95
7.4.220.0090.00916.89
7.4.210.0030.01616.98
7.4.200.0030.00316.84
7.4.160.0050.01016.75
7.4.150.0090.01317.40
7.4.140.0080.01017.86
7.4.130.0100.01116.73
7.4.120.0100.00716.82
7.4.110.0120.00616.97
7.4.100.0100.01316.75
7.4.90.0140.00316.60
7.4.80.0030.01319.39
7.4.70.0030.01316.86
7.4.60.0070.01016.88
7.4.50.0060.00316.83
7.4.40.0140.00416.63
7.4.30.0070.01016.72
7.4.00.0070.01015.42
7.3.330.0000.00613.36
7.3.320.0050.00013.45
7.3.310.0040.00416.66
7.3.300.0070.00016.54
7.3.290.0070.00916.52
7.3.280.0090.01016.55
7.3.270.0120.01217.40
7.3.260.0100.01316.79
7.3.250.0130.00316.50
7.3.240.0080.01516.77
7.3.230.0090.01516.75
7.3.210.0070.01016.49
7.3.200.0080.00816.46
7.3.190.0090.00916.43
7.3.180.0090.00616.41
7.3.170.0130.00916.92
7.3.160.0070.01016.43
7.2.330.0180.00016.89
7.2.320.0120.00616.82
7.2.310.0080.00816.98
7.2.300.0140.00316.91
7.2.290.0150.00617.07
7.2.60.0000.01417.12
7.2.00.0030.00919.82
7.1.200.0030.00915.90
7.1.100.0000.01017.95
7.1.70.0060.00317.24
7.1.60.0100.01319.50
7.1.50.0070.01417.21
7.1.00.0130.06722.38
7.0.200.0000.00917.02
7.0.60.0100.08319.96
7.0.50.0070.04317.87
7.0.40.0070.07720.05
7.0.30.0270.07720.06
7.0.20.0200.04720.19
7.0.10.0130.07720.02
7.0.00.0100.03720.23
5.6.280.0030.03021.10
5.6.210.0100.07720.62
5.6.200.0070.05318.18
5.6.190.0100.05020.41
5.6.180.0370.07320.41
5.6.170.0370.05720.54
5.6.160.0070.08720.50
5.6.150.0000.04318.14
5.6.140.0170.07318.14
5.6.130.0070.03718.14
5.6.120.0030.04021.02
5.6.110.0030.09021.01
5.6.100.0170.07721.13
5.6.90.0270.05020.99
5.6.80.0070.06720.25
5.5.350.0000.03320.29
5.5.340.0070.07017.93
5.5.330.0030.04320.43
5.5.320.1100.04720.30
5.5.310.0300.06720.20
5.5.300.0000.04718.02
5.5.290.0070.08017.99
5.5.280.0070.07020.88
5.5.270.0000.04720.61
5.5.260.0000.06020.79
5.5.250.0070.08020.61
5.5.240.0130.06020.12
5.4.450.0170.05719.27
5.4.440.0200.05019.39
5.4.430.0170.05019.47
5.4.420.0070.05719.47
5.4.410.0230.05719.38
5.4.400.0030.06318.92
5.4.390.0130.05318.95
5.4.380.0070.05718.78
5.4.370.0030.05718.80
5.4.360.0170.05719.10
5.4.350.0070.05319.16
5.4.340.0100.05319.18
5.4.320.0130.05019.05
5.4.310.0130.05018.95
5.4.300.0100.05019.06
5.4.290.0100.05019.25
5.4.280.0170.05319.12
5.4.270.0030.06019.18
5.4.260.0100.05018.91
5.4.250.0130.04719.06
5.4.240.0130.06019.10
5.4.230.0100.05319.17
5.4.220.0130.07019.27
5.4.210.0200.06019.14
5.4.200.0230.06018.90
5.4.190.0100.05319.17
5.4.180.0130.05018.78
5.4.170.0100.05318.94
5.4.160.0130.04719.14
5.4.150.0100.05319.10
5.4.140.0100.05016.27
5.4.130.0070.05716.52
5.4.120.0130.04716.36
5.4.110.0100.05016.55
5.4.100.0130.05016.61
5.4.90.0300.05016.50
5.4.80.0070.05016.20
5.4.70.0130.04316.52
5.4.60.0070.05716.46
5.4.50.0130.05716.34
5.4.40.0070.05316.42
5.4.30.0100.05016.27
5.4.20.0170.04316.34
5.4.10.0130.05716.16
5.4.00.0100.04715.73

preferences:
55.66 ms | 401 KiB | 5 Q