3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Slug($string){ $result = preg_replace("/[^A-Za-z0-9./-_~]/", '', $string); return $result; /*return trim(preg_replace('~[^0-9a-zA-Z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')), '-');*/ } $user = 'Cómo hablar en sílabas'; var_dump(Slug($user)); // como-hablar-en-silabas $user = 'Álix Ãxel'; var_dump(Slug($user)); // alix-axel $user = 'Álix----_Ãxel!?!?'; var_dump(Slug($user)); // alix-axel

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.0170.00016.88
8.3.50.0040.01117.93
8.3.40.0140.00718.75
8.3.30.0070.00718.71
8.3.20.0050.00221.94
8.3.10.0050.00323.66
8.3.00.0000.00819.56
8.2.180.0030.01718.18
8.2.170.0070.01422.96
8.2.160.0030.01020.24
8.2.150.0110.00424.18
8.2.140.0060.00324.66
8.2.130.0030.00620.47
8.2.120.0040.00426.35
8.2.110.0030.00721.03
8.2.100.0040.00817.84
8.2.90.0040.00419.05
8.2.80.0050.00317.97
8.2.70.0030.00517.80
8.2.60.0000.00817.93
8.2.50.0040.00419.23
8.2.40.0040.00420.42
8.2.30.0040.00419.19
8.2.20.0000.00817.99
8.2.10.0000.00818.06
8.2.00.0050.00218.11
8.1.280.0040.01125.92
8.1.270.0080.00018.73
8.1.260.0000.00726.35
8.1.250.0070.00328.09
8.1.240.0030.00721.34
8.1.230.0040.00718.90
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0000.00917.23
8.1.190.0030.00517.13
8.1.180.0000.00818.10
8.1.170.0000.00920.93
8.1.160.0060.00318.88
8.1.150.0000.00720.32
8.1.140.0000.00719.51
8.1.130.0000.00720.62
8.1.120.0000.00817.43
8.1.110.0060.00317.38
8.1.100.0000.00817.37
8.1.90.0040.00417.43
8.1.80.0040.00417.31
8.1.70.0050.00317.33
8.1.60.0030.00517.44
8.1.50.0000.00717.56
8.1.40.0060.00317.52
8.1.30.0050.00317.68
8.1.20.0090.00017.56
8.1.10.0050.00217.50
8.1.00.0000.00817.39
8.0.300.0080.00018.77
8.0.290.0050.00316.63
8.0.280.0080.00018.38
8.0.270.0030.00317.20
8.0.260.0000.00718.73
8.0.250.0000.00716.90
8.0.240.0000.00716.82
8.0.230.0050.00316.94
8.0.220.0000.00716.79
8.0.210.0080.00016.87
8.0.200.0030.00616.92
8.0.190.0040.00416.96
8.0.180.0040.00416.89
8.0.170.0000.00716.90
8.0.160.0000.00716.91
8.0.150.0070.00016.90
8.0.140.0000.00716.89
8.0.130.0000.00613.29
8.0.120.0050.00216.79
8.0.110.0000.00716.90
8.0.100.0040.00416.84
8.0.90.0070.00016.85
8.0.80.0130.00716.90
8.0.70.0030.00516.93
8.0.60.0040.00416.94
8.0.50.0080.00016.99
8.0.30.0100.00917.16
8.0.20.0110.01017.40
8.0.10.0000.00716.94
8.0.00.0120.00616.67
7.4.330.0000.00515.55
7.4.320.0030.00316.50
7.4.300.0000.00616.58
7.4.290.0000.00616.36
7.4.280.0030.00616.57
7.4.270.0080.00016.55
7.4.260.0000.01116.46
7.4.250.0040.00416.46
7.4.240.0000.00716.65
7.4.230.0040.00416.25
7.4.220.0060.01916.62
7.4.210.0060.01116.53
7.4.200.0000.00716.59
7.4.160.0040.01216.56
7.4.150.0090.00917.40
7.4.140.0110.00717.86
7.4.130.0150.00616.54
7.4.120.0100.01116.48
7.4.110.0080.00816.68
7.4.100.0060.01116.53
7.4.90.0040.01716.43
7.4.80.0050.01119.39
7.4.70.0070.01116.36
7.4.60.0060.01316.34
7.4.50.0080.00316.21
7.4.40.0100.00716.44
7.4.30.0200.02916.33
7.4.00.0060.01214.84
7.3.330.0000.00713.18
7.3.320.0030.00313.29
7.3.310.0000.00716.20
7.3.300.0070.00016.31
7.3.290.0090.00516.33
7.3.280.0070.00916.29
7.3.270.0170.00017.40
7.3.260.0130.00516.39
7.3.250.0130.00916.40
7.3.240.0120.01116.42
7.3.230.0100.01116.32
7.3.210.0110.00816.54
7.3.200.0090.00916.32
7.3.190.0110.00716.46
7.3.180.0150.00616.59
7.3.170.0150.00616.21
7.3.160.0050.01116.51
7.3.10.0070.00716.59
7.3.00.0080.00416.75
7.2.330.0150.00416.29
7.2.320.0080.00816.57
7.2.310.0140.01016.18
7.2.300.0120.00416.69
7.2.290.0060.01116.52
7.2.130.0000.01516.75
7.2.120.0060.00916.75
7.2.110.0060.00316.80
7.2.100.0110.00416.71
7.2.90.0030.00716.88
7.2.80.0080.00316.69
7.2.70.0030.00916.72
7.2.60.0090.00616.55
7.2.50.0080.00416.79
7.2.40.0030.01716.82
7.2.30.0000.01016.85
7.2.20.0090.00316.65
7.2.10.0100.00516.54
7.2.00.0070.00918.13
7.1.250.0090.00615.92
7.1.200.0070.00315.71
7.1.70.0000.01016.86
7.1.60.0600.01333.15
7.1.50.0470.02033.08
7.1.40.0800.01032.55
7.1.30.1670.02032.77
7.1.20.0630.01732.78
7.1.10.0630.01314.73
7.1.00.0600.02314.55
7.0.200.0470.01014.96
7.0.190.0430.00714.92
7.0.180.0500.00714.38
7.0.170.0570.00714.13
7.0.160.0500.01014.51
7.0.150.0770.00314.18
7.0.140.0800.01714.56
7.0.130.0670.01014.61
7.0.120.0700.01714.57
7.0.110.0570.01014.55
7.0.100.0670.01714.48
7.0.90.0730.01014.32
7.0.80.0470.01714.18
7.0.70.0530.01014.21
7.0.60.0500.01714.14
7.0.50.0770.01314.42
7.0.40.0730.00714.78
7.0.30.0900.00314.52
7.0.20.0970.0039.79
7.0.10.0870.01014.55
7.0.00.0970.01014.48

preferences:
60.18 ms | 400 KiB | 5 Q