3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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'))
Output for 5.6.30, 7.0.0 - 7.2.9
Parse error: syntax error, unexpected end of file in /in/oNqWu on line 34
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected $end in /in/oNqWu:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected $end in /in/oNqWu:34 Stack trace: #0 {main}
Process exited with code 255.