3v4l.org

run code in 300+ PHP versions simultaneously
<?php function op_slugify($title) { $output = ''; $valid_characters = 'abcdefghijklmnopqrstuvwxyz1234567890'; $len = strlen($title); for ($i = 0;$i < $len;$i++) { if (stripos($valid_characters, $title[$i]) !== FALSE) { // Letters and numbers are valid $output .= strtolower($title[$i]); } elseif ($i > 0 && stripos($valid_characters, $title[$i - 1]) !== FALSE) { // Other characters are turned into dashes, but never two // in a row. $output .= '-'; } } if (substr($output, -1, 1) === '-') { return substr($output, 0, -1); } else { return $output; } } echo op_slugify('The Old, North State!!');

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.40.0150.00618.97
8.3.30.0060.00819.18
8.3.20.0040.00420.31
8.3.10.0080.00023.56
8.3.00.0080.00019.50
8.2.170.0120.00322.96
8.2.160.0070.00720.38
8.2.150.0070.00024.18
8.2.140.0040.01124.66
8.2.130.0070.00026.16
8.2.120.0080.00020.96
8.2.110.0030.00622.01
8.2.100.0080.00418.16
8.2.90.0000.00819.25
8.2.80.0000.00817.97
8.2.70.0000.01017.50
8.2.60.0000.00918.04
8.2.50.0060.00318.07
8.2.40.0000.00718.22
8.2.30.0000.00718.17
8.2.20.0030.00517.72
8.2.10.0040.00418.13
8.2.00.0040.00417.68
8.1.270.0080.00423.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00023.91
8.1.230.0030.00719.09
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0030.00517.35
8.1.180.0000.00918.10
8.1.170.0060.00618.64
8.1.160.0030.00522.02
8.1.150.0070.00018.89
8.1.140.0000.00717.39
8.1.130.0030.00317.87
8.1.120.0000.00717.49
8.1.110.0040.00417.50
8.1.100.0040.00417.46
8.1.90.0000.00717.41
8.1.80.0040.00417.39
8.1.70.0000.00717.46
8.1.60.0000.01117.63
8.1.50.0040.00417.52
8.1.40.0000.00917.55
8.1.30.0030.00517.61
8.1.20.0000.00917.65
8.1.10.0000.00717.51
8.1.00.0030.00617.41
8.0.300.0000.00818.77
8.0.290.0090.00016.63
8.0.280.0040.00418.36
8.0.270.0000.00717.17
8.0.260.0070.00017.26
8.0.250.0030.00316.91
8.0.240.0040.00416.85
8.0.230.0000.00716.89
8.0.220.0000.00616.77
8.0.210.0030.00316.86
8.0.200.0030.00317.00
8.0.190.0000.00716.91
8.0.180.0030.00616.96
8.0.170.0040.00416.98
8.0.160.0040.00416.96
8.0.150.0000.00716.80
8.0.140.0040.00416.83
8.0.130.0050.00013.32
8.0.120.0000.00716.87
8.0.110.0050.00216.73
8.0.100.0050.00216.93
8.0.90.0040.00417.02
8.0.80.0040.01116.85
8.0.70.0040.00416.89
8.0.60.0000.00716.75
8.0.50.0000.00816.73
8.0.30.0160.00717.36
8.0.20.0080.01117.40
8.0.10.0030.00516.96
8.0.00.0120.00516.65
7.4.330.0000.00515.14
7.4.320.0000.00616.51
7.4.300.0030.00316.61
7.4.290.0040.00416.52
7.4.280.0040.00416.41
7.4.270.0000.00616.52
7.4.260.0000.00716.48
7.4.250.0040.00416.46
7.4.240.0040.00416.49
7.4.230.0030.00316.49
7.4.220.0150.00316.59
7.4.210.0040.01116.63
7.4.200.0040.00416.68
7.4.160.0070.00716.48
7.4.150.0030.01417.40
7.4.140.0100.00617.86
7.4.130.0070.00916.56
7.4.120.0130.00416.65
7.4.110.0120.00616.45
7.4.100.0060.01116.38
7.4.90.0070.01416.65
7.4.80.0070.01519.39
7.4.70.0100.00516.34
7.4.60.0070.01016.57
7.4.50.0000.00616.54
7.4.40.0100.00916.37
7.4.30.0090.00616.59
7.4.00.0070.00914.77
7.3.330.0030.00313.36
7.3.320.0000.00513.28
7.3.310.0080.00016.31
7.3.300.0030.00316.23
7.3.290.0150.00016.38
7.3.280.0090.00716.37
7.3.270.0080.01117.40
7.3.260.0120.01316.39
7.3.250.0080.01016.30
7.3.240.0080.00816.65
7.3.230.0060.01016.39
7.3.210.0130.01016.42
7.3.200.0090.00819.39
7.3.190.0060.01116.31
7.3.180.0090.00616.36
7.3.170.0110.00416.37
7.3.160.0100.00616.36
7.3.120.0040.01414.83
7.3.110.0030.01414.63
7.3.100.0030.01314.74
7.3.90.0090.00614.68
7.3.80.0040.01114.72
7.3.70.0070.00714.93
7.3.60.0030.01014.87
7.3.50.0090.00614.46
7.3.40.0000.01314.84
7.3.30.0100.00314.68
7.3.20.0090.00316.56
7.3.10.0040.01116.76
7.3.00.0000.00816.61
7.2.330.0150.00416.62
7.2.320.0090.00916.52
7.2.310.0060.01216.70
7.2.300.0130.00316.57
7.2.290.0130.01016.45
7.2.250.0070.01015.32
7.2.240.0140.00714.97
7.2.230.0080.00415.04
7.2.220.0070.00714.90
7.2.210.0130.00014.87
7.2.200.0030.01015.21
7.2.190.0040.01414.95
7.2.180.0140.00015.13
7.2.170.0090.00615.18
7.2.00.0040.00819.47
7.1.330.0080.00315.75
7.1.320.0040.01115.96
7.1.310.0040.00815.45
7.1.300.0060.00915.64
7.1.290.0040.01115.71
7.1.280.0040.01515.76
7.1.270.0120.00415.52
7.1.260.0070.00715.77
7.1.100.0350.00712.08
7.1.70.0030.00517.34
7.1.60.0030.00919.40
7.1.50.0040.00816.98
7.1.00.0030.07322.54
7.0.200.0060.00316.53
7.0.140.0030.07321.94
7.0.60.0170.07320.09
7.0.50.0130.07317.89
7.0.40.0130.04320.25
7.0.30.0500.07720.15
7.0.20.0200.07720.07
7.0.10.0070.07320.15
7.0.00.0070.05720.33
5.6.280.0030.07321.11
5.6.210.0070.03720.76
5.6.200.0070.04718.29
5.6.190.0100.03720.46
5.6.180.0070.08320.61
5.6.170.0400.07720.51
5.6.160.0130.04720.57
5.6.150.0030.08718.16
5.6.140.0170.07018.27
5.6.130.0200.07718.28
5.6.120.0030.05020.99
5.6.110.0070.03720.99
5.6.100.0230.05320.98
5.6.90.0030.04020.98
5.6.80.0130.07320.38
5.5.350.0030.05720.40
5.5.340.0130.06017.97
5.5.330.0100.04020.28
5.5.320.0370.05020.38
5.5.310.0130.04320.27
5.5.300.0030.04317.98
5.5.290.0130.04317.91
5.5.280.0030.04720.85
5.5.270.0070.06320.87
5.5.260.0100.06320.94
5.5.250.0070.08720.54
5.5.240.0130.06720.28
5.4.450.0570.04319.43
5.4.440.0330.05319.54
5.4.430.0570.04319.53
5.4.420.0430.04319.54
5.4.410.0400.03019.34
5.4.400.0500.04719.08
5.4.390.0430.04018.89
5.4.380.0200.06318.59
5.4.370.0370.04718.57
5.4.360.0300.05318.70
5.4.350.0430.05318.47
5.4.340.0270.05318.76
5.4.320.0090.03512.50
5.4.310.0100.03812.50
5.4.300.0120.03112.50
5.4.290.0070.04012.50
5.4.280.0040.03812.40
5.4.270.0060.03812.39
5.4.260.0040.04112.40
5.4.250.0080.03812.39
5.4.240.0090.03312.40
5.4.230.0020.04112.39
5.4.220.0070.03712.39
5.4.210.0030.03912.39
5.4.200.0030.04112.39
5.4.190.0090.03312.39
5.4.180.0070.03412.38
5.4.170.0090.03312.39
5.4.160.0060.04112.39
5.4.150.0040.04112.38
5.4.140.0070.03712.07
5.4.130.0070.03712.06
5.4.120.0090.03112.02
5.4.110.0070.03612.02
5.4.100.0090.03712.02
5.4.90.0050.03712.02
5.4.80.0080.03712.02
5.4.70.0060.03712.01
5.4.60.0030.03712.01
5.4.50.0090.03712.01
5.4.40.0060.04112.00
5.4.30.0050.03911.99
5.4.20.0090.03512.00
5.4.10.0090.03211.99
5.4.00.0080.03211.48
5.3.290.0070.03712.80
5.3.280.0070.03712.71
5.3.270.0080.03612.73
5.3.260.0070.03712.72
5.3.250.0040.03812.72
5.3.240.0070.03612.72
5.3.230.0080.03512.70
5.3.220.0070.03612.68
5.3.210.0080.03812.68
5.3.200.0080.03612.68
5.3.190.0090.04012.68
5.3.180.0080.04412.67
5.3.170.0060.03612.67
5.3.160.0050.04012.68
5.3.150.0050.04912.67
5.3.140.0060.04512.66
5.3.130.0060.05112.66
5.3.120.0040.04112.66
5.3.110.0090.03712.66
5.3.100.0040.04012.12
5.3.90.0080.03512.10
5.3.80.0060.03612.09
5.3.70.0080.03412.09
5.3.60.0050.03712.08
5.3.50.0080.03412.02
5.3.40.0090.03512.02
5.3.30.0060.03511.98
5.3.20.0100.03611.76
5.3.10.0050.03611.73
5.3.00.0100.03211.71
5.2.170.0090.0279.21
5.2.160.0080.0319.21
5.2.150.0050.0319.21
5.2.140.0050.0309.21
5.2.130.0050.0299.17
5.2.120.0040.0299.17
5.2.110.0070.0319.18
5.2.100.0060.0309.17
5.2.90.0050.0299.18
5.2.80.0040.0319.17
5.2.70.0040.0329.17
5.2.60.0050.0319.13
5.2.50.0070.0399.10
5.2.40.0060.0279.07
5.2.30.0070.0269.04
5.2.20.0050.0279.04
5.2.10.0060.0268.94
5.2.00.0040.0298.80
5.1.60.0040.0298.08
5.1.50.0090.0248.08
5.1.40.0050.0258.06
5.1.30.0050.0318.41
5.1.20.0020.0318.43
5.1.10.0040.0268.16
5.1.00.0040.0268.16
5.0.50.0070.0176.65
5.0.40.0050.0176.52
5.0.30.0030.0326.32
5.0.20.0040.0206.29
5.0.10.0040.0196.27
5.0.00.0030.0306.26
4.4.90.0030.0154.78
4.4.80.0040.0164.75
4.4.70.0030.0164.75
4.4.60.0030.0154.75
4.4.50.0040.0144.77
4.4.40.0010.0304.71
4.4.30.0020.0204.76
4.4.20.0030.0164.84
4.4.10.0040.0164.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0050.0124.67
4.3.90.0000.0174.64
4.3.80.0020.0244.58
4.3.70.0020.0154.63
4.3.60.0010.0164.63
4.3.50.0020.0234.63
4.3.40.0070.0294.54
4.3.30.0020.0163.32
4.3.20.0010.0173.29
4.3.10.0030.0143.25
4.3.00.0070.01715.63

preferences:
39.79 ms | 400 KiB | 5 Q