3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Convert all dashes/underscores into separator $title = "Convert all dashes/underscores into separator"; $separator = "-" $flip = $separa;tor == '-' ? '_' : '-'; $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)
5.6.140.0100.03318.15
5.6.130.0070.05318.21
5.6.120.0030.04320.98
5.6.110.0030.09021.01
5.6.100.0130.07721.08
5.6.90.0130.03320.84
5.6.80.0130.05320.50
5.5.300.0070.05317.92
5.5.290.0030.08318.04
5.5.280.0030.04020.95
5.5.270.0130.08020.72
5.5.260.0070.08320.72
5.5.250.0000.04320.46
5.5.240.0270.06720.12
5.4.450.0300.05319.61
5.4.440.0270.05719.60
5.4.430.0300.06319.57
5.4.420.0230.05019.16
5.4.410.0100.05319.23
5.4.400.0100.05018.84
5.4.390.0170.04719.22
5.4.380.0230.05718.89
5.4.370.0370.04318.98
5.4.360.0230.05719.25
5.4.350.0400.04719.25
5.4.340.0400.04318.98
5.4.320.0300.06019.14
5.4.310.0270.05319.27
5.4.300.0270.05319.22
5.4.290.0300.05319.05
5.4.280.0330.04719.27
5.4.270.0370.05018.99
5.4.260.0270.07018.84
5.4.250.0330.07019.14
5.4.240.0200.05319.21
5.4.230.0330.04319.13
5.4.220.0200.06019.15
5.4.210.0300.04719.35
5.4.200.0200.05718.82
5.4.190.0270.05018.96
5.4.180.0230.06019.24
5.4.170.0330.05719.27
5.4.160.0330.06319.20
5.4.150.0370.05019.23
5.4.140.0200.05316.43
5.4.130.0300.04316.55
5.4.120.0430.05316.39
5.4.110.0230.05316.28
5.4.100.0200.05016.52
5.4.90.0270.05316.43
5.4.80.0230.04716.43
5.4.70.0270.04716.61
5.4.60.0230.04716.57
5.4.50.0200.05316.55
5.4.40.0170.05316.17
5.4.30.0270.04716.22
5.4.20.0230.04716.25
5.4.10.0300.04716.39
5.4.00.0330.04315.86

preferences:
142.37 ms | 1394 KiB | 7 Q