3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Class UsernameGenerator * @package Gibb\EventoBundle\Generator */ class GlobalAcronymGenerator { /** * Ersetzt alle Umlaute * @param $s string|array * @return string|array */ private static function getGlobalAcronym($string) { $s = str_replace(array("Ä", "Ö", "Ü", "ä", "ö", "ü", "ß"), array("Ae", "Oe", "Ue", "ae", "oe", "ue", "ss"), $string); $r = ''; $s1 = @iconv('UTF-8', 'ASCII//TRANSLIT', $s); for ($i = 0; $i < strlen($s1); $i++) { $ch1 = $s1[$i]; $ch2 = mb_substr($s, $i, 1); $r .= $ch1 == '?' ? $ch2 : $ch1; } $r = preg_replace('=\W=is', '_', $r); return $r; } } var_dump(GlobalAcronymGenerator::getGlobalAcronym('hs def älö ?Wef32'))

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)
7.2.90.0660.00814.50
7.2.80.0050.01014.59
7.2.70.0590.00714.78
7.2.60.0390.01014.63
7.2.50.0520.00714.73
7.2.40.0620.00714.67
7.2.30.0090.00914.74
7.2.20.0060.01314.70
7.2.10.0730.00314.89
7.2.00.0660.00314.77
7.1.210.0480.00413.91
7.1.200.0190.00513.72
7.1.190.0090.00613.69
7.1.180.0130.00013.50
7.1.170.0790.00313.79
7.1.160.0130.00713.78
7.1.150.0100.00713.63
7.1.140.0090.00913.68
7.1.130.0030.00913.62
7.1.120.0490.00713.55
7.1.110.0510.00313.46
7.1.100.0540.00313.84
7.1.90.0510.01413.69
7.1.80.1060.00713.95
7.1.70.0500.00913.79
7.1.60.0760.01331.86
7.1.50.0260.01031.89
7.1.40.1230.01531.71
7.1.30.0440.00031.84
7.1.20.0230.01231.66
7.1.10.0210.00613.58
7.1.00.0700.00313.62
7.0.310.0080.00513.26
7.0.300.0770.00013.45
7.0.290.0270.00413.25
7.0.280.0680.00613.30
7.0.270.0100.00313.46
7.0.260.0790.00613.45
7.0.250.0490.00313.31
7.0.240.0570.00313.21
7.0.230.0620.00613.32
7.0.220.0630.00313.31
7.0.210.0590.00913.63
7.0.200.0610.00613.23
7.0.190.0810.00013.36
7.0.180.0770.01013.19
7.0.170.0550.01113.22
7.0.160.0680.00313.34
7.0.150.0310.00713.42
7.0.140.0090.00313.48
7.0.130.0590.00613.41
7.0.120.0690.00713.50
7.0.110.0710.00713.36
7.0.100.1070.00713.48
7.0.90.1130.01312.96
7.0.80.0580.00613.52
7.0.70.0520.00313.36
7.0.60.0120.00313.54
7.0.50.0660.00713.50
7.0.40.0690.00713.25
7.0.30.0610.00313.64
7.0.20.0040.00813.38
7.0.10.0120.00413.17
7.0.00.0070.01113.33

preferences:
145.37 ms | 1394 KiB | 7 Q