3v4l.org

run code in 300+ PHP versions simultaneously
<?php static public function slugify($text) { // replace non letter or digits by - $text = preg_replace('~[^\\pL\d]+~u', '-', $text); // trim $text = trim($text, '-'); // transliterate $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); // lowercase $text = strtolower($text); // remove unwanted characters $text = preg_replace('~[^-\w]+~', '', $text); if (empty($text)) { return 'n-a'; } return $text; } $string = "andrés EFI收购Cretaprint"; echo slugify($string);

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)
5.4.150.0150.04712.35
5.4.140.0250.06412.04
5.4.130.0160.04312.02
5.4.120.0180.05411.99
5.4.110.0160.03911.98
5.4.100.0180.03911.98
5.4.90.0160.04311.98
5.4.80.0160.04211.98
5.4.70.0150.04411.98
5.4.60.0150.04311.98
5.4.50.0240.06411.98
5.4.40.0150.04511.97
5.4.30.0160.04211.96
5.4.20.0140.04511.96
5.4.10.0170.03811.96
5.4.00.0130.04611.46
5.3.250.0150.04412.71
5.3.240.0170.04312.72
5.3.230.0170.04312.71
5.3.220.0150.04612.68
5.3.210.0150.04612.68
5.3.200.0180.06312.68
5.3.190.0160.04612.68
5.3.180.0270.06512.67
5.3.170.0260.06412.67
5.3.160.0150.04512.67
5.3.150.0160.04312.67
5.3.140.0130.04512.66
5.3.130.0190.04212.66
5.3.120.0180.04312.66
5.3.110.0160.04412.66
5.3.100.0150.04312.12
5.3.90.0230.08012.08
5.3.80.0170.04312.07
5.3.70.0150.04712.07
5.3.60.0150.04312.06
5.3.50.0140.04512.00
5.3.40.0110.04812.00
5.3.30.0200.06711.94
5.3.20.0230.06711.72
5.3.10.0150.04411.68
5.3.00.0300.06311.66

preferences:
139.32 ms | 1394 KiB | 7 Q